這是我的lighttpd配置文件Typo3 + Fastcgi + Fam和低內存和積極調優。在我的web服務器使用Lighttpd而不是Apache進行服務器ram(512M)之前,我有了25M的免費ram,而Typo3的運行速度更快。我希望它有幫助嗎?
## maximum concurrent connections the server will accept (1/2 of server.max-fds)
server.max-connections = 1024
# Maximum number of file descriptors, default = 1024
server.max-fds = 2048
# Maximum number of request within a keep-alive session before the server terminates the connection, default = 16
server.max-keep-alive-requests = 0
# Maximum number of seconds until an idling keep-alive connection is dropped, default = 5
server.max-keep-alive-idle = 1
# Maximum number of seconds until a waiting, non keep-alive read times out and closes the connection, default = 60
server.max-read-idle = 15
# Maximum number of seconds until a waiting write call times out and closes the connection, default = 360
server.max-write-idle = 15
# Which event handler to use, default = poll
server.event-handler = "linux-sysepoll"
# How to handle network writes, default = writev
server.network-backend = "linux-sendfile"
# Requires FAM or Gamin to be installed, default = simple
server.stat-cache-engine = "fam"
# Whether to update the atime setting on file access, default = disable
server.use-noatime = "enable"
## single client connection bandwidth limit in kilobytes (0=unlimited)
connection.kbytes-per-second = 0
## global server bandwidth limit in kilobytes (0=unlimited)
server.kbytes-per-second = 0
#### expire module
expire.url = ("" => "access plus 20 days")
#### mod_evasive
evasive.max-conns-per-ip = 250
#### limit request method "POST" size in kilobytes (KB)
server.max-request-size = 1024
#### disable multi range requests
server.range-requests = "disable"
# selecting modules
server.modules = (
"mod_rewrite",
# "mod_redirect",
# "mod_alias",
"mod_access",
# "mod_cml",
# "mod_trigger_b4_dl",
# "mod_auth",
# "mod_status",
"mod_setenv",
"mod_fastcgi",
# "mod_proxy",
# "mod_simple_vhost",
# "mod_evhost",
# "mod_userdir",
# "mod_cgi",
"mod_compress",
# "mod_ssi",
# "mod_usertrack",
"mod_expire",
# "mod_secdownload",
# "mod_rrdtool",
"mod_accesslog",
"mod_evasive"
)
fastcgi.server = (".php" =>
(("socket" => "/tmp/php-fastcgi.socket",
"bin-path" => "/usr/bin/php-cgi",
"max-procs" => 5,
"idle-timeout" => 20,
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "10",
"PHP_FCGI_MAX_REQUESTS" => "5000"
),
"broken-scriptfilename" => "enable"
))
)
感謝分享配置,我根據你的配置做了必要的修改,但是一旦負載達到了4.00 lighttpd restart,雖然我有監視器來完成我的工作。 –
@JyotirBhandari當負載達到4.0時,monit是否會重啓lighttpd? – j0k
是的,當負載是4.00時,有index.php文件,我每隔1分鐘由monit調用一次,如果它沒有被獲取,那麼monit重新啓動lighty,並且根據觀察,負載通常是4.00 –