论坛首页 编程语言技术论坛

lighttpd + fastcgi 真耗内存呀

浏览 8407 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2011-09-26  
每个进程占用内存多少?
换其他部署方式有改善吗?
0 请登录后投票
   发表时间:2011-09-26  
kiol 写道
每个进程占用内存多少?
换其他部署方式有改善吗?


压力不大的时段,每个fcgi占29M内存,压力大的时候,每个占300M以上,配置了10个进程,但实际跑了20个,我还得研究下,看看哪里配置有问题(以前配置的是20个)
0 请登录后投票
   发表时间:2011-09-26  
zeeler 写道
原因是php-cgi会在每个请求结束的时候回收脚本使用的全部内存,但是并不会释放给操作系统,而是继续持有以应对下一次PHP请求。

这不是优点吗,明天我查查服务器。
0 请登录后投票
   发表时间:2011-09-27  
查了一下,8G的内存用了一半不到,当然原因是根本没什么人访问,大多是爬虫。
nginx+fastcgi
0 请登录后投票
   发表时间:2011-09-28  
弄个自动释放内存的优化软件,,
0 请登录后投票
   发表时间:2011-09-29  
用nginx吧,我一直用,比较稳定。
0 请登录后投票
   发表时间:2011-09-29  
zeeler 写道
今天是彻底的满了:
$ free
             total       used       free     shared    buffers     cached
Mem:       8165016    8144672      20344          0       6036      20880
-/+ buffers/cache:    8117756      47260
Swap:      2048248    2048248          0




我怀疑是你某些参数太夸张了,贴出来看看吧。
0 请登录后投票
   发表时间:2011-09-29  
kaki 写道
zeeler 写道
今天是彻底的满了:
$ free
             total       used       free     shared    buffers     cached
Mem:       8165016    8144672      20344          0       6036      20880
-/+ buffers/cache:    8117756      47260
Swap:      2048248    2048248          0


我怀疑是你某些参数太夸张了,贴出来看看吧。


$HTTP["host"] =~ "^(api.yourname.com|.*?)$" {
  $HTTP["url"] =~ "^/iphone/" {
    server.document-root = "/var/www/rails/iphone/current/public"
    alias.url = ("/iphone" => "/var/www/rails/iphone/current/public")
    server.error-handler-404 = "/iphone/dispatch.fcgi"
    var.server_name = "iphone"
    server.name = server_name
    accesslog.filename = log_root + "/" + server_name + "/access.log"
    #accesslog.filename = "/dev/null"
    fastcgi.server = (
                "/iphone/dispatch.fcgi" =>
                (
                "iphone1" => ("socket" => "/tmp/lighttpd/socket/iphone.socket-1", "check-local" => "disable"),
                "iphone2" => ("socket" => "/tmp/lighttpd/socket/iphone.socket-2", "check-local" => "disable"),
                "iphone3" => ("socket" => "/tmp/lighttpd/socket/iphone.socket-3", "check-local" => "disable"),
                "iphone4" => ("socket" => "/tmp/lighttpd/socket/iphone.socket-4", "check-local" => "disable"),
                "iphone5" => ("socket" => "/tmp/lighttpd/socket/iphone.socket-5", "check-local" => "disable"),
                "iphone6" => ("socket" => "/tmp/lighttpd/socket/iphone.socket-6", "check-local" => "disable"),
                "iphone7" => ("socket" => "/tmp/lighttpd/socket/iphone.socket-7", "check-local" => "disable"),
                "iphone8" => ("socket" => "/tmp/lighttpd/socket/iphone.socket-8", "check-local" => "disable"),
                "iphone9" => ("socket" => "/tmp/lighttpd/socket/iphone.socket-9", "check-local" => "disable"),
                "iphone10" => ("socket" => "/tmp/lighttpd/socket/iphone.socket-10", "check-local" => "disable"),
        )
    )
  }
  $HTTP["url"] =~ "^/ipad/" {
    server.document-root = "/var/www/rails/ipad/current/public"
    alias.url = ("/ipad" => "/var/www/rails/ipad/current/public")
    server.error-handler-404 = "/ipad/dispatch.fcgi"
    var.server_name = "ipad"
    server.name = server_name
    accesslog.filename = "/dev/null"
    fastcgi.server = (
                "/ipad/dispatch.fcgi" =>
                (
                        "ipad1" => ("socket" => "/tmp/lighttpd/socket/ipad.socket-1", "check-local" => "disable"),
                        "ipad2" => ("socket" => "/tmp/lighttpd/socket/ipad.socket-2", "check-local" => "disable"),
                        "ipad3" => ("socket" => "/tmp/lighttpd/socket/ipad.socket-3", "check-local" => "disable"),
                        "ipad4" => ("socket" => "/tmp/lighttpd/socket/ipad.socket-4", "check-local" => "disable"),
                        "ipad5" => ("socket" => "/tmp/lighttpd/socket/ipad.socket-5", "check-local" => "disable")
        )
    )
  }
0 请登录后投票
论坛首页 编程语言技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics