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

报告相同问题?

悬赏问题

  • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
  • ¥15 marlin编译错误,如何解决?
  • ¥15 有偿四位数,节约算法和扫描算法
  • ¥15 VUE项目怎么运行,系统打不开
  • ¥50 pointpillars等目标检测算法怎么融合注意力机制
  • ¥20 Vs code Mac系统 PHP Debug调试环境配置
  • ¥60 大一项目课,微信小程序
  • ¥15 求视频摘要youtube和ovp数据集