douba3378 2016-06-18 14:51
浏览 74

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?

  • 写回答

2条回答 默认 最新

  • dqusbxh44823 2017-02-08 08:25
    关注

    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
    
    评论

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?