-1

I have xampp apache runnnig on my windows 8, 64 bit laptop. With symfony 2, the TTFB is about 4 sec, on prod, for every server response and about 8-10 secs on dev. I have no idea how to reduce this to under 1 sec. It is not possible to work with such latency.

To isolate the issue I did the following 1. localhost/xampp/ loads very fast (within 1 sec) 2. localhost/ims/web/test.php loads immediately. ims is the symfony2 project. The test.php has

Please tell me how to reduce the TTFB. It does seem to be an apache issue.

3
  • Did you check where is the bottleneck in the profiler timeline? Commented Jul 25, 2015 at 20:42
  • I am doing web development after a very long time. From the profiler timeline I cant see the evidence that I see in the chrome dev app timeline. Please advise what all things can I check. Commented Jul 26, 2015 at 22:35
  • It seem to be Symfony/component/security/http/firewall and the controller; these two take 80% of the time. Still can't tell if the firewall is responsible for high TTFB Commented Jul 27, 2015 at 2:47

1 Answer 1

0

If the firewall is using database for authenticate users maybe the bottleneck is in the database connection itself. Look at this link http://12wiki.blogspot.com/2012/11/why-does-symfony-2-firewall-take-so.html. Changing database_host from localhost to 127.0.0.1 solved the problem.

Sign up to request clarification or add additional context in comments.

4 Comments

This is the result of a small ajax query using GET. Connection Setup TIME Stalled ​ 1.571 ms DNS Lookup ​ 0.898 ms Initial connection ​ 1.025 ms Request/Response TIME Request sent ​ 2.019 ms Waiting (TTFB) ​ 2.07 s Content Download ​ 1.192 ms.<br><br> I hace a very high TFTB of 2000 ms compared to the 10 ms of actual work done.
I NEED SOME SERIOUS HELP HERE. I can't do ajax with this kind of slow response. There must be a solution to this. I really appreciate anyone giving a good clue.
One more difference I noted. All the assets in DEV takes longer (php, js, css and png). In PROD environment, only the php takes longer and everything else is superfast.
I followed suggestion on the following post to bring the ttfb a tad bit lower but not much. stackoverflow.com/questions/9854848/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.