CodeIgniter Forums
TTFB realy heavy - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: TTFB realy heavy (/showthread.php?tid=67974)



TTFB realy heavy - bakaa - 05-03-2017

Hi guys,

I am new to the codeigniter's forum, and i would like to ask you something about the time to first byte in your webapp.

I always developed mine under EasyPHP web server, and i always had a heavy TTFB, so i am wondering if it is due to my computer or stuff like that. I dont think i am doing wrong with not needed stuff, my current project is realy lite..

I just read something about ipv4 & ipv6 over SQL queries that might take more than 1sec because MySQL could not resolve localhost with ipv6 so he switched to ipv4... going for 127.0.0.1 instead did not solve my issue so i tried some caching stuff.

I gained 0.5s with this but TTFB still over 1s and its pretty hard, someone have an idea about what is going on ? 

Ty in advance

Best regards.

Bakaa


RE: TTFB realy heavy - InsiteFX - 05-03-2017

Use the CodeIgniter Profiler to check your database queries etc;


RE: TTFB realy heavy - xenomorph1030 - 05-03-2017

There are so many variables such as the machine (cpu/memory), the network and network speed, the operating system, firewalls, your webserver (HTTPD in this case), the application itself, and more of course. I haven't used anything like EasyPHP, so I cannot speak for it. My typical stack is Ubuntu, Nginx, PHP-FPM, CloudFlare CDN. My maximum first byte is 0.5 seconds.

Are you using a CDN? It will make the load times more consistent as opposed to loading from a single server.


RE: TTFB realy heavy - bakaa - 05-03-2017

Well i am on windows 7 , and im not using any CDN, only requesting google for fonts , but it appear after the http response, my issue probably comes with my computer setup.

What is codeigniter profiler?


RE: TTFB realy heavy - PaulD - 05-03-2017

In your controller add:

PHP Code:
$this->output->enable_profiler(TRUE); 

Then your webpage will have lots of useful stuff appended to it.

In the docs: https://www.codeigniter.com/user_guide/general/profiling.html

You may also be interested in benchmarking: https://www.codeigniter.com/user_guide/libraries/benchmark.html