-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.

  • Did you check where is the bottleneck in the profiler timeline? – Absalón Valdés Jul 25 '15 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. – Rajeev Pandey Jul 26 '15 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 – Rajeev Pandey Jul 27 '15 at 02:47

1 Answers1

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.

Absalón Valdés
  • 910
  • 7
  • 16
  • 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.

    I hace a very high TFTB of 2000 ms compared to the 10 ms of actual work done.
    – Rajeev Pandey Jul 27 '15 at 20:53
  • 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. – Rajeev Pandey Jul 27 '15 at 20:56
  • 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. – Rajeev Pandey Jul 27 '15 at 20:58
  • I followed suggestion on the following post to bring the ttfb a tad bit lower but not much. http://stackoverflow.com/questions/9854848/windows-7-php-symfony2-terribly-slow – Rajeev Pandey Jul 30 '15 at 03:45