Symfony2共享主机坏性能可能缓存?

I use the default config of Symfony2 app.php

> <?php
> 
> use Symfony\Component\ClassLoader\ApcClassLoader; use
> Symfony\Component\HttpFoundation\Request;
> 
> $loader = require_once __DIR__.'/../app/bootstrap.php.cache';
> 
> // Enable APC for autoloading to improve performance. // You should
> change the ApcClassLoader first argument to a unique prefix // in
> order to prevent cache key conflicts with other applications // also
> using APC. /* $apcLoader = new ApcClassLoader(sha1(__FILE__),
> $loader); $loader->unregister(); $apcLoader->register(true);
> */
> 
> require_once __DIR__.'/../app/AppKernel.php'; //require_once
> __DIR__.'/../app/AppCache.php';
> 
> $kernel = new AppKernel('prod', false); $kernel->loadClassCache();
> //$kernel = new AppCache($kernel);
> 
> // When using the HttpCache, you need to call the method in your front
> controller instead of relying on the configuration parameter
> //Request::enableHttpMethodParameterOverride(); $request =
> Request::createFromGlobals(); $response = $kernel->handle($request);
> $response->send(); $kernel->terminate($request, $response);`

Now to my issue:

I have local apache who render some templates in Symfony 2 project in 200ms-250ms in prod. There is no database in the background. Now my issue is that if i request same page in webhost i have request time from 1sec to 8sec.

I just have some layout twigs and then the content partials in.

I dont know why i got so high requests times here is a reques header example:

General: Request URL:http://####/## 
Request Method:GET 
Status Code:200 OK 
Remote Address:####

Response Headers: view source 
Cache-Control:no-cache 
Connection:Keep-Alive 
Content-Type:text/html; charset=UTF-8 Date:Sat, 18 Jun 2016 14:41:39 GMT 
Keep-Alive:timeout=2, max=98 
Server:Apache 
Transfer-Encoding:chunked X-Powered-By:PHP/7.0.6

Anyone have a idea to get some information to debug or maybe someone know the reason of the bad performance on webserver?

Maybe help some modifications to the server like described here: http://symfony.com/doc/current/performance.html

Especially

; php.ini
realpath_cache_size=4096K
realpath_cache_ttl=600

The simple answer is: It depends.

Performance is always a topic where it is hard to say what's the problem when you donn't know the code and environment. You have to measure it.

With Symfony it's easy to get a simple measurement by using the Profiler Toolbar. Just install and enable it on your application. You will see the toolbar at the bottom of the page. On the performance tab you get a pretty nice overview on what time is spent for rendering, controllers etc. Based on this informations you can optimize your code or environment.

Profiler - Image from the Symfony Blog

If you need more insight about performance you can try xhProf, xDebug or commercial tools like Blackfire or Tideways.