symfony actions are super slow on localhost - symfony1

I've setup MAMP on OSX 10.6 and the exact same symfony code takes over 6 seconds to run on localhost and 200ms on my server. My web debug bar says the time hit comes from processing the action. I've tried it the production mode on localhost and the speed boost was minor, time went to 3 seconds instead of 6. Still ridiculously slow compared to my server.
The strange thing is that non symfony php code runs correctly and fast.

You can try Xdebug profiler to find out precisely which part of symfony is so slow.

Related

Wicked PDF takes around 2 minutes when in production

I have an app and an API. The app runs in production on a server with Debian 7, which gives me problems with the gem. In the other hand, the API runs on another sever with Debian 9, in which there´s no problem with wicked_pdf. So, when I want to download a PDf file, I make a call to the API where I send specific parameters to render some images and text.
When I am in local development, with the app in port 3000 and the API in port 3001, there´s no problem. It works and the logs show 'Completed 200 OK in X ms' where X is never more than 7 or 8.
The problem comes when I deploy the API in it´s corresponding server. There´s no error like missing libraries, or syntax errors or no method errors. What happens is that the API takes around 2 minutes to render the file and show 'Completed 200 OK in 121000ms'. Obviously, by the time the task is completed, the app already timed out like 1 minute and 40 seconds earlier. I already changed wkhtmltopdf-binary version to 0.9.9 but the results are the same.

webpack-dev-server extremely slow to load on new machine

I've been working on a project from my laptop for the past few months. When webpack compiles my code, reloading the page takes around 1 second.
I've now moved to my desktop, and loading the page takes about 11 seconds in Chrome. I'm using the same version of node, webpack-dev-server and webpack on both machines (windows 10).
Chrome:
Edge:
Blazing fast in Chrome on my other machine:
I've also disabled all the extensions to no avail. I can't find a pattern, but this is not consistent on edge, it would load for the same 11 seconds there as well, but not always. Any ideas how i could address this?
This wasn't related to webpack at all, it just looked weird. The issue seems to have something to do with steam (or steamVR), and there was a bug report for chrome:
https://bugs.chromium.org/p/chromium/issues/detail?id=1202090#c38
Opening two tabs, and reloading them side by side would not suffer from this 11 second delay. Updating steam seems to have resolved the issue.

What could cause my MVC apps to be incredibly slow to start?

Extremely often, in all kinds of various MVC3/4 apps I debug in VS2012 on my home machine, after pressing F5 to start debugging and open the configured start page in Chrome, it can take several - up to ten - minutes before becoming active.
I have no long startup procedures that load caches or generate code etc. and the same app will start instantly on my office machine. Quite often it will do so on my home machine as well, but this slow starting seems to come about after some hours of debugging, and possibly certain operations. Restarting VS doesn't seem to help, neither does killing IIS Express.
We were faced with an identical scenario recently where attaching the application to the debugger resulted in each page load taking about 10 minutes each, but running without debugging or in the QA environment worked fine.
The problem turned out to be that log4net was configured to use a network path for storing log files, a path that was unavailable from our local setup. This resulted in multiple attempts at accessing a remote path (once for each class being set up with Spring .Net) that didn't exist (and hence log4net threw an exception in each case).
But this should impact you out of the box, and shouldn't increase with time..

Does Struts 2 have any memory issues

I have a webapp developed with struts2 deployed in tomcat 5.5. The server has other applications deployed in it. But the app created with struts2 is very slow. Any ideas? How does Struts 2 handle object creation? And is there anything I can do on the tomecat server..
How slow is it? What are you doing? are you sure it is Struts 2 that is slow and not your application code? Did you do any profiling? What were the results?
Check this out: http://struts.apache.org/2.2.1/docs/performance-tuning.html
I found serving the static content from a folder increased the speed.
Well few details are really required for some one to answer your question in more good way
Which Struts2 version you are using
At which place/part do you think application is slow
as per my experience there are certain areas where Struts2 have known problems, OGNL in itself sometime creates problem since this is the part of the framework which took most of the time, this has been known to fixed in 3.x version of OGNL so you can get new jar of OGNL and than can test your application.
Second use some profiler and it will help you to catch the culprit like any thread blocking etc.
What OS is Tomcat running on?
If it's Linux, you may have run into a lack of entropy issue.
If this command returns something less than 200, it could explain your issue:
cat /proc/sys/kernel/random/entropy_avail
If it is low (or watch during startup/making requests), try pointing /dev/random to /dev/urandom. (Not for secure Production, but to test in Dev should be fine):
mv /dev/random /dev/random.orig
ln -s /dev/urandom /dev/random
And try starting Tomcat again.

.NET MVC Slow Site

I have a site that is taking around 20 seconds to load every page (no matter what it does)
So i put in a /scripts/test.html that isn't part of a route and it still takes this long... no db hit nothing.
I renamed the web.config to _web.config and it loads instantly, rename it back... back to around 20-30 second load times.
Running the application locally... i put a breakpoint on the RegisterRoutes in the Global.asax.cs and ran that... /scripts/test.html does not hit breakpoint normal site does (site loads instaly fast locally on the same database/code)
Server is Mosso IIS7/SQL Server 2008 Cluster
The site is being hit pretty hard... ANY help please? or things to test/debug?
Few things to try:
Try taking a look with FileMon/ProcessMonitor and see if there is a ton of disk activity.
If the above is not an issue, install an instance of Dot Trace by Jet Brains. Profile the app and see if there is some memory or performance issue that is not apparent on your local box.
I saw another related issue that was solved by disabling IPv6, maybe try that.

Resources