title: Long Time to First Byte value for an empty php file
body: <p>I had such <a href="https://stackoverflow.com/questions/12116746/cakephp-sites-main-pages-time-to-first-byte-is-very-long">question</a> some months ago. Now to isolate the problem I tried a new approach. I put an empty file to my server.</p>
  
  <p>File name is "foobar.php". Its content is as follows:</p>
  
  <pre><code>&lt;?php
  echo "hello world";
  </code></pre>
  
  <p>But when I try to enter to <strong>example.com/foobar.php</strong>, I get  </p>
  
  <blockquote>
    <p>DNS 203 mseconds<br>
    Connect 3.33 seconds<br>
    Send 0 miliseconds<br>
    Time to First Byte 17.35 seconds<br>
    Receive 1 miliseconds
    Total load time 20.88 seconds</p>
  </blockquote>
  
  <p>Then I put another file called "foobar.txt". Its content is as follows:</p>
  
  <pre><code>hello world&lt;br/&gt;
  </code></pre>
  
  <p>Loading time of <strong>foobar.txt</strong> is approximeately 0.2 seconds.</p>
  
  <p>This website is inside a shared hosting so I can't get a root Linux access. I'm trying to find out what makes my site slow.</p>
  
  <ul>
  <li>When I get these results I have 60 visitors in my site. And they send AJAX requests when they are active. When they are active they send an AJAX request nearly every 3 seconds. </li>
  <li>Generally my website has 5-20 requests per second.</li>
  <li>My hosting provider says that there occurs no CPU overload, it is very low generally.    </li>
  <li>I asked hosting company for Apache limits. I get this values for the whole shared server:  </li>
  </ul>
  
  <blockquote>
    <p>MaxClients 300<br>
    MaxRequestsPerChild 4000<br>
    ThreadsPerChild 25</p>
  </blockquote>
  
  <ul>
  <li><strong>example.com/mybigpage.php</strong> and <strong>example.com/foobar.php</strong> pages are opened nearly at the same time.</li>
  <li>If page has txt, jpeg or other extensions they are opened instantly. If extension is php it opens very slow.</li>
  <li>CakePHP stores session files inside "/httpdocs/app/tmp/sessions" folder. Session files are deleted after two hours of creation. Now there is 3653 files inside that folder. Oldest file is created 2,5 hours ago.</li>
  <li>In my configuration, PHP handler is Apache module mod_php</li>
  </ul>
  
  <p><strong>New Edit:</strong>
  I talked with my hosting company. And told them that "foobar.php" is opened nearly in 20 seconds. Although that file has no code at all. They told me that they put "foobar.php" to other websites that we use same server. I also tried "othersite.com/foobar.php". It opened instantly. But "mysite.com/foobar.php" opened nearly in 15 seconds. What would make this behaviour? We use same PHP configuration with other sites, but they open instantly..
  Can it be because of my .htaccess rules? Or other thing?</p>
  
  <p><strong>New Edit2:</strong>
  My provider told me that there exists no "apd.so" file inside the server. So it seems like I can't use APD.</p>
  
  <p>What should I look for to find the bottleneck?<br>
  What would limit my site?</p>
  
  <hr>
  
  <p>Additional data: from the phpinfo, I get this:</p>
  
  <blockquote>
    <p>'./configure' '--prefix=/usr/local/lsws/lsphp5'
    '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu'
    '--target=x86_64-redhat-linux-gnu' '--sysconfdir=/etc'
    '--datadir=/usr/share' '--includedir=/usr/include'
    '--libdir=/usr/lib64' '--libexecdir=/usr/libexec'
    '--localstatedir=/var' '--sharedstatedir=/usr/com'
    '--mandir=/usr/share/man' '--infodir=/usr/share/info'
    '--cache-file=../config.cache' '--with-libdir=lib64'
    '--with-config-file-path=/etc'
    '--with-config-file-scan-dir=/etc/php.dd' '--disable-debug'
    '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2'
    '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr'
    '--with-png-dir=/usr' '--without-gdbm' '--with-gettext' '--with-gmp'
    '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl'
    '--with-libexpat-dir=/usr/lib64' '--with-pcre-regex=/usr'
    '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp'
    '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem'
    '--enable-sysvshm' '--enable-sysvmsg' '--enable-wddx'
    '--with-kerberos' '--enable-ucd-snmp-hack'
    '--with-unixODBC=shared,/usr' '--enable-shmop' '--enable-calendar'
    '--with-libxml-dir=/usr' '--with-mysql' '--with-mysqli' '--with-gd'
    '--enable-dom' '--disable-dba' '--without-unixODBC'
    '--enable-xmlreader' '--enable-xmlwriter' '--with-mcrypt'
    '--enable-mbstring' '--with-litespeed' '--enable-soap' '--with-xsl'
    '--with-pdo-mysql' '--with-pdo-sqlite' '--enable-sqlite-utf8'
    '--with-pspell' '--with-sqlite=shared' '--with-xmlrpc' '--with-mhash'
    '--enable-pdo' '--with-imap' '--with-imap-ssl' '--without-suhosin'
    '--with-tidy' '--enable-zip' '--enable-inline-optimization'
    '--enable-gd-native-ttf' '--enable-bcmath'</p>
  </blockquote>