Webserver (lighty) tunen - Langsam zu hochzeiten :(

Apache, Lighttpd, nginx, Cherokee
malo
Posts: 61
Joined: 2005-01-03 22:40

Webserver (lighty) tunen - Langsam zu hochzeiten :(

Post by malo » 2007-08-29 23:40

Moin

habe lighttpd-1.4.13 (ssl) - a light and fast webserver am laufen.
auf folgender Maschine:
Model: AMD Athlon(tm) 64 Processor 3700+
Chip Mhz: 2199.86 (i686)
2GB RAM

Auf dem Server läuft unter anderem in kleinerer IMG Hoster (~600 neue Bilder werden täglich hochgeladen ). (130.000 Bilder insgesamt)

In Hochzeiten habe ich ziemlich viele connections. Das ding ist, die Auslieferung von z.B. erfolgt erst recht spät und nach ner Wartezeit.
z.B. http://pictransfer.de/index.php?img=701 ... 53ajpg.jpg
braucht lange bis alles geladen ist. > nur in stoßzeiten dauert das so lange. Bzw es dauert anscheinend Lange, bis der webserver überhaupt erst anfängt die daten zu übermitteln.

hat einer ne Idee, bzw Kniff wo ich noch was ändern muss, damit das ohne probleme klappt ?

Danke schon mal!
> aktuell jetzt ( 23:35) gibts mir die server-status auflistung aus

Code: Select all

Server-Status
Hostname   213.133.98.131 ()
Uptime   6 min 48 s
Started at   2007-08-29 23:27:59
absolute (since start)
Requests   41 kreq
Traffic   812.12 Mbyte
average (since start)
Requests   100 req/s
Traffic   1.99 Mbyte/s
average (5s sliding average)
Requests   109 req/s
Traffic   2.17 Mbyte/s

legend
. = connect, C = close, E = hard error
r = read, R = read-POST, W = write, h = handle-request
q = request-start,  Q = request-end
s = response-start, S = response-end
654 connections
WWWWWWWWWWWWWWWWWWWWWWWWWWWWrWWWWWWWWWrWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWrWWWWWWWWWWWWWW
rWWWWWWWWrWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWrWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWhWWWWWWWWWWWWWWWWWWr
WWWWrWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
WWrWWWWWrWWWWWWWWWWWWWWWWWWWWWWWWWWWrWWWWWrWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWrWWWWWWWWWWWWWWWWWWW
WWWWrWWWWWWWWWWWWWWWWWWWWWWWWWWWWhWWWWWWWWWWWWWWWW
WWrWWWWWWWWWWrWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
WrWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWrWWW
WWWWWWWWWWWWWWWrWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWrW
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWrrWWWWWWWWWWWWWWWWW
rrWW



top gibts mir aus

Code: Select all

top - 23:36:36 up 16:08,  1 user,  load average: 0.30, 0.31, 0.34
Tasks: 379 total,   1 running, 378 sleeping,   0 stopped,   0 zombie
Cpu(s): 11.2%us,  1.9%sy,  0.0%ni, 79.9%id,  3.6%wa,  0.9%hi,  2.5%si,  0.0%st
Mem:   2076000k total,  1994172k used,    81828k free,    98080k buffers
Swap:  2096440k total,       48k used,  2096392k free,  1414964k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
16903 www-data  15   0 26992  22m  928 S  3.9  1.1   0:14.55 lighttpd
17188 www-data  20   0 23436 6912 4208 S  3.9  0.3   0:00.13 php5-cgi
17189 www-data  21   0 23456 7312 4604 S  3.9  0.4   0:00.12 php5-cgi
17367 root      15   0  2360 1212  772 R  2.0  0.1   0:00.02 top
    1 root      15   0  1948  652  552 S  0.0  0.0   0:00.86 init
    2 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0
    3 root      34  19     0    0    0 S  0.0  0.0   0:00.01 ksoftirqd/0
    4 root      10  -5     0    0    0 S  0.0  0.0   0:00.02 events/0
    5 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 khelper
    6 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 kthread
    9 root      10  -5     0    0    0 S  0.0  0.0   0:00.04 kblockd/0
   10 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 kacpid
  101 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kseriod
  141 root      25   0     0    0    0 S  0.0  0.0   0:00.00 pdflush
  142 root      15   0     0    0    0 S  0.0  0.0   0:02.28 pdflush
  143 root      10  -5     0    0    0 S  0.0  0.0   0:00.87 kswapd0
  144 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 aio/0


php.ini

Code: Select all

[PHP]
;;;;;;;;;;;;;;;;;;;;
; Language Options ;
;;;;;;;;;;;;;;;;;;;;


engine = On
zend.ze1_compatibility_mode = Off
short_open_tag = On
asp_tags = Off
precision    =  14
y2k_compliance = On
output_buffering = On
zlib.output_compression = On
zlib.output_compression_level = -1
zlib.output_handler =
implicit_flush = Off
unserialize_callback_func=
serialize_precision = 100
allow_call_time_pass_reference = Off
safe_mode = Off
safe_mode_gid = Off
safe_mode_include_dir =
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
open_basedir = NULL
disable_functions = system, shell_exec, popen, pclose, proc_open, proc_close, proc_get_status, proc_nice, proc_terminate, exec, passthru, show_source, escapeshellcmd, escapeshellarg
disable_classes =
expose_php = Off

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 300
max_input_time = 600
memory_limit = 32M

;;;;;;;;;;;;;;;;;;
; Error Handling ;
;;;;;;;;;;;;;;;;;;

error_reporting  =  E_ALL & ~E_NOTICE
display_errors = on
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
report_zend_debug = 0
track_errors = Off
html_errors = Off
error_log = "/var/log/lighttpd/phperr_log"

;;;;;;;;;;;;;;;;;
; Data Handling ;
;;;;;;;;;;;;;;;;;
variables_order = "EGPCS"
register_globals = On
register_long_arrays = on
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 8M
magic_quotes_gpc = On
magic_quotes_runtime = Off
magic_quotes_sybase = Off
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
doc_root =
user_dir =
enable_dl = On

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;
file_uploads = On
upload_max_filesize = 10M
cgi.fix_pathinfo = 1

;;;;;;;;;;;;;;;;;;
; Fopen wrappers ;
;;;;;;;;;;;;;;;;;;

allow_url_fopen = on
allow_url_include = on
from = "anonymous@localhost"
user_agent = ""
default_socket_timeout = 60
auto_detect_line_endings = Off



[Date]
;date.timezone =
;date.default_latitude = 31.7667
;date.default_longitude = 35.2333
;date.sunrise_zenith = 90.583333
;date.sunset_zenith = 90.583333

[filter]
;filter.default = unsafe_raw
;filter.default_flags =

[iconv]
;iconv.input_encoding = ISO-8859-1
;iconv.internal_encoding = ISO-8859-1
;iconv.output_encoding = ISO-8859-1

[sqlite]
;sqlite.assoc_case = 0

[xmlrpc]
;xmlrpc_error_number = 0
;xmlrpc_errors = 0

[Pcre]
;pcre.recursion_limit = 100000
;pcre.backtrack_limit = 100000

[Syslog]
define_syslog_variables = Off

[mail function]
SMTP = localhost
smtp_port = 25
;sendmail_path = "/usr/sbin/sendmail -t -i"
;mail.force_extra_parameters =

[SQL]
sql.safe_mode = Off

[MySQL]
mysql.allow_persistent = Off
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off

[MySQLi]
mysqli.max_links = -1
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off

[PostgresSQL]
pgsql.allow_persistent = Off
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0

[bcmath]
bcmath.scale = 0

[browscap]
;browscap = "extra/browscap.ini"

[Session]
session.save_handler = files
session.save_path = "/dev/shm"
session.use_cookies = 1
session.cookie_secure =
session.use_only_cookies = 0
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = "/"
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.bug_compat_42 = 0
session.bug_compat_warn = 1
session.referer_check =
session.entropy_length = 16
session.entropy_file = "/dev/urandom"
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 1
session.hash_bits_per_character = 6
url_rewriter.tags = "a=href,area=href,frame=src,input=src,fieldset="

[Assertion]
assert.active = On
assert.warning = On
assert.bail = Off
assert.callback = 0
assert.quiet_eval = 0

[mbstring]
;mbstring.language = Japanese
;mbstring.internal_encoding = EUC-JP
;mbstring.http_input = auto
;mbstring.http_output = SJIS
;mbstring.encoding_translation = Off
;mbstring.detect_order = auto
;mbstring.substitute_character = none;
;mbstring.func_overload = 0
;mbstring.strict_encoding = Off

[gd]
gd.jpeg_ignore_warning = 0

[exif]
;exif.encode_unicode = ISO-8859-15
;exif.decode_unicode_motorola = UCS-2BE
;exif.decode_unicode_intel = UCS-2LE
;exif.encode_jis =
;exif.decode_jis_motorola = JIS
;exif.decode_jis_intel = JIS

[Tidy]
;tidy.default_config = "/usr/share/php/default.tcfg"
tidy.clean_output = Off

[soap]
soap.wsdl_cache_enabled = 1
soap.wsdl_cache_dir = "/tmp"
soap.wsdl_cache_ttl = 86400

; Local Variables:
; tab-width: 4
; End:

apc.enabled=1
apc.shm_segments=1
apc.optimization=0
apc.shm_size=128
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=1024
apc.mmap_file_mask="/tmp/apc.XXXXXX"
apc.enable_cli=0


lighttpd.conf

Code: Select all

# lighttpd configuration file
#
# use a it as base for lighttpd 1.0.0 and above
#
# $Id: lighttpd.conf,v 1.7 2004/11/03 22:26:05 weigon Exp $

############ Options you really have to take care of ####################


### KEEPALIVE ##

server.max-keep-alive-requests = 0
server.max-keep-alive-idle = 0



## modules to load
# at least mod_access and mod_accesslog should be loaded
# all other module should only be loaded if really neccesary
# - saves some time
# - saves memory
server.modules              = (
                                "mod_rewrite",
                                "mod_redirect",
                 "mod_access",
            "mod_auth",
                                "mod_status",
                  "mod_fastcgi",
#            "mod_simple_vhost",
#            "mod_evhost",
            "mod_cgi",
#            "mod_compress",
#                               "mod_ssi",
#                               "mod_usertrack",
#             "mod_rrdtool",
            "mod_accesslog" )

## a static document-root, for virtual-hosting take look at the
## server.virtual-* options
server.document-root             = "/var/www/"

## where to send error-messages to
server.errorlog            = "/var/log/lighttpd/error.log"

# files to check for if .../ is requested
server.indexfiles          = ( "index.php", "index.html",
                                "index.htm", "default.htm" )

# mimetype mapping
mimetype.assign            = ( 
  ".pdf"          =>      "application/pdf",
  ".sig"          =>      "application/pgp-signature",
  ".spl"          =>      "application/futuresplash",
  ".class"        =>      "application/octet-stream",
  ".ps"           =>      "application/postscript",
  ".torrent"      =>      "application/x-bittorrent",
  ".dvi"          =>      "application/x-dvi",
  ".gz"           =>      "application/x-gzip",
  ".pac"          =>      "application/x-ns-proxy-autoconfig",
  ".swf"          =>      "application/x-shockwave-flash",
  ".tar.gz"       =>      "application/x-tgz",
  ".tgz"          =>      "application/x-tgz",
  ".tar"          =>      "application/x-tar",
  ".zip"          =>      "application/zip",
  ".php3"         =>      "application/x-httpd-php",
  ".mp3"          =>      "audio/mpeg",
  ".m3u"          =>      "audio/x-mpegurl",
  ".wma"          =>      "audio/x-ms-wma",
  ".wax"          =>      "audio/x-ms-wax",
  ".ogg"          =>      "audio/x-wav",
  ".wav"          =>      "audio/x-wav",
  ".gif"          =>      "image/gif",
  ".jpg"          =>      "image/jpeg",
  ".jpeg"         =>      "image/jpeg",
  ".png"          =>      "image/png",
  ".xbm"          =>      "image/x-xbitmap",
  ".xpm"          =>      "image/x-xpixmap",
  ".xwd"          =>      "image/x-xwindowdump",
  ".css"          =>      "text/css",
  ".html"         =>      "text/html",
  ".htm"          =>      "text/html",
  ".js"           =>      "text/javascript",
  ".asc"          =>      "text/plain",
  ".c"            =>      "text/plain",
  ".conf"         =>      "text/plain",
  ".text"         =>      "text/plain",
  ".txt"          =>      "text/plain",
  ".dtd"          =>      "text/xml",
  ".xml"          =>      "text/xml",
  ".mpeg"         =>      "video/mpeg",
  ".mpg"          =>      "video/mpeg",
  ".mov"          =>      "video/quicktime",
  ".qt"           =>      "video/quicktime",
  ".avi"          =>      "video/x-msvideo",
  ".asf"          =>      "video/x-ms-asf",
  ".asx"          =>      "video/x-ms-asf",
  ".wmv"          =>      "video/x-ms-wmv"
 )

# Use the "Content-Type" extended attribute to obtain mime type if possible
# mimetype.use-xattr = "enable"

#### accesslog module
accesslog.filename          = "/var/log/lighttpd/access.log"
accesslog.format = "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i""

## deny access the file-extensions
#
# ~    is for backupfiles from vi, emacs, joe, ...
# .inc is often used for code includes which should in general not be part
#      of the document-root
url.access-deny             = ( "~", ".inc" )



######### Options that are good to be but not neccesary to be changed #######

## bind to port (default: 80)
#server.port                = 81

## bind to localhost (default: all interfaces)
#server.bind                = "grisu.home.kneschke.de"

## error-handler for status 404
#server.error-handler-404   = "/error-handler.html"
#server.error-handler-404   = "/error-handler.php"

## to help the rc.scripts
server.pid-file              = "/var/run/lighttpd.pid"


###### virtual hosts
##
##   If you want name-based virtual hosting add the next three settings and load
##   mod_simple_vhost
##
## document-root =
##   virtual-server-root + virtual-server-default-host + virtual-server-docroot or
##   virtual-server-root + http-host + virtual-server-docroot
##
#simple-vhost.server-root         = "/home/weigon/wwwroot/servers/"
#simple-vhost.default-host        = "grisu.home.kneschke.de"
#simple-vhost.document-root       = "/pages/"


##
## Format: <errorfile-prefix><status>.html
## -> ..../status-404.html for 'File not found'
#server.errorfile-prefix    = "/home/weigon/projects/lighttpd/doc/status-"

## virtual directory listings
#server.dir-listing          = "enable"

## send unhandled HTTP-header headers to error-log
#debug.dump-unknown-headers  = "enable"

### only root can use these options
#
# chroot() to directory (default: no chroot() )
#server.chroot            = "/"

## change uid to <uid> (default: don't care)
server.username            = "www-data"

## change uid to <uid> (default: don't care)
server.groupname           = "www-data"

#### compress module
#compress.cache-dir          = "/var/tmp/lighttpd/cache/compress/"
#compress.filetype = (
#    "text/javascript",
#    "text/plain",
#    "text/html",
#    "text/css",
#    "text/xml",
#)

#### fastcgi module
## read fastcgi.txt for more info

fastcgi.server    = ( ".php" =>
                           ((
                          "bin-path" => "/usr/bin/php5-cgi",
                          "socket" => "/tmp/php.socket",
                          "max-procs" => 10,
                          "idle-timeout" => 30,
                          "bin-environment" => (
                            "PHP_FCGI_CHILDREN" => "32",
                            "PHP_FCGI_MAX_REQUESTS" => "10000"),
                          "bin-copy-environment" => (
                            "PATH", "SHELL", "USER"),
                          "broken-scriptfilename" => "enable"
                           ))
                    )

#### Server.event.handle
server.event-handler = "linux-sysepoll"
server.max-fds = 12000

#### CGI module
cgi.assign                  = ( ".pl"  => "/usr/bin/perl",
                                ".cgi" => "/usr/bin/perl" )

#### SSL engine
#ssl.engine                  = "enable"
#ssl.pemfile                 = "server.pem"

#### status module
status.status-url = "/server-status"
#status.config-url = "/server-config"

#### auth module
## read authentification.txt for more info
# auth.backend                = "plain"
# auth.backend.plain.userfile = "lighttpd.user"
# auth.backend.plain.groupfile = "lighttpd.group"

# auth.backend.ldap.hostname = "localhost"
# auth.backend.ldap.base-dn  = "dc=my-domain,dc=com"
# auth.backend.ldap.filter   = "(uid=$)"

# auth.require                = ( "/server-status" =>
#                                (
#              "method"  => "digest",
#              "realm"   => "download archiv",
#              "require" => "group=www|user=jan|host=192.168.2.10"
#            ),
#            "/server-info" =>
#                                (
#              "method"  => "digest",
#              "realm"   => "download archiv",
#              "require" => "group=www|user=jan|host=192.168.2.10"
#            )
#                              )

#### url handling modules (rewrite, redirect, access)
# url.rewrite                 = ( "^/$"             => "/server-status" )
# url.redirect                = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )

#
# define a pattern for the host url finding
# %% => % sign
# %0 => domain name + tld
# %1 => tld
# %2 => domain name without tld
# %3 => subdomain 1 nament


# %4 => subdomain 2 name
#
# evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/"

#### expire module
# expire.url                  = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")

#### ssi
# ssi.extension              = ( ".shtml" )

#### rrdtool
# rrdtool.binary = "/usr/bin/rrdtool"
# rrdtool.db-name = "/var/www/lighttpd.rrd"
#########################################
#### INCLUDEN der einzelnen Domains #####
#########################################
include "world-of-smilies.com.conf"
include "pictransfer.de.conf"
include "besucherstats.de.conf"
include "4rm.de.conf"
include "newsoase.de.conf"
include "domains.conf"
include "webmasterscene.de.conf"
include "netdieb.de.conf"
include "emailtauschen.de.conf"
include "machowitze.de.conf"
include "ji1.de.conf"
include "spiele4free.de.conf"
include "voten.biz.conf"
include "gutpokern.de.conf"
include "popstars-monrose.de.conf"
include "send4free.de.conf"

mccab99
Posts: 43
Joined: 2006-02-20 08:41
Location: Cloppenburg

Re: Webserver (lighty) tunen - Langsam zu hochzeiten :(

Post by mccab99 » 2007-08-30 09:21

Machst du einmal ein "top -u www-data"?

Die Anzahl der php5-cgi-Prozesse kommt mir - falls das ein top-Snapshot zur "Hochzeit" ist, recht klein vor.

Maik

User avatar
Joe User
Project Manager
Project Manager
Posts: 11138
Joined: 2003-02-27 01:00
Location: Hamburg

Re: Webserver (lighty) tunen - Langsam zu hochzeiten :(

Post by Joe User » 2007-08-30 17:02

Geringfügig überarbeitete lighttpd.conf:

Code: Select all

server.username = "www-data"
server.groupname = "www-data"
server.stat-cache-engine = "fam"
server.event-handler = "linux-sysepoll"
server.pid-file = "/var/run/lighttpd.pid"
server.errorlog = "/var/log/lighttpd/error.log"
server.document-root = "/var/www/"
server.max-keep-alive-requests = 0
server.max-keep-alive-idle = 0
server.max-fds = 12288
server.modules = (
    "mod_rewrite",
    "mod_redirect",
    "mod_alias",
    "mod_access",
    "mod_auth",
    "mod_setenv",
    "mod_expire",
    "mod_fastcgi",
    "mod_cgi",
    "mod_ssi",
    "mod_compress",
    "mod_status",
    "mod_accesslog",
)
server.indexfiles = (
    "index.xhtml",
    "index.html",
    "index.htm",
    "index.php",
)
mimetype.assign = (
    ".pdf"     => "application/pdf",
    ".sig"     => "application/pgp-signature",
    ".spl"     => "application/futuresplash",
    ".class"   => "application/octet-stream",
    ".ps"      => "application/postscript",
    ".torrent" => "application/x-bittorrent",
    ".dvi"     => "application/x-dvi",
    ".pac"     => "application/x-ns-proxy-autoconfig",
    ".swf"     => "application/x-shockwave-flash",
    ".tgz"     => "application/x-tgz",
    ".mp3"     => "audio/mpeg",
    ".m3u"     => "audio/x-mpegurl",
    ".wma"     => "audio/x-ms-wma",
    ".wax"     => "audio/x-ms-wax",
    ".ogg"     => "application/ogg",
    ".wav"     => "audio/x-wav",
    ".xbm"     => "image/x-xbitmap",
    ".xpm"     => "image/x-xpixmap",
    ".xwd"     => "image/x-xwindowdump",
    ".asc"     => "text/plain",
    ".c"       => "text/plain",
    ".h"       => "text/plain",
    ".cc"      => "text/plain",
    ".cpp"     => "text/plain",
    ".hh"      => "text/plain",
    ".hpp"     => "text/plain",
    ".conf"    => "text/plain",
    ".log"     => "text/plain",
    ".text"    => "text/plain",
    ".txt"     => "text/plain",
    ".diff"    => "text/plain",
    ".patch"   => "text/plain",
    ".ebuild"  => "text/plain",
    ".eclass"  => "text/plain",
    ".rtf"     => "application/rtf",
    ".bmp"     => "image/bmp",
    ".tif"     => "image/tiff",
    ".tiff"    => "image/tiff",
    ".ico"     => "image/x-icon",
    ".mpeg"    => "video/mpeg",
    ".mpg"     => "video/mpeg",
    ".mov"     => "video/quicktime",
    ".qt"      => "video/quicktime",
    ".avi"     => "video/x-msvideo",
    ".asf"     => "video/x-ms-asf",
    ".asx"     => "video/x-ms-asf",
    ".wmv"     => "video/x-ms-wmv",
    ".tbz"     => "application/x-bzip-compressed-tar",
    ".tar.bz2" => "application/x-bzip-compressed-tar",
    ".tar.gz"  => "application/x-tgz",
    ".bz2"     => "application/x-bzip",
    ".gz"      => "application/x-gzip",
    ".tar"     => "application/x-tar",
    ".zip"     => "application/zip",
    ".jpeg"    => "image/jpeg",
    ".jpg"     => "image/jpeg",
    ".png"     => "image/png",
    ".gif"     => "image/gif",
    ".xhtml"   => "text/html",
    ".html"    => "text/html",
    ".htm"     => "text/html",
    ".dtd"     => "text/xml",
    ".xml"     => "text/xml",
    ".css"     => "text/css",
    ".js"      => "text/javascript",
    ".php"     => "application/x-httpd-php",
#    ""         => "text/plain",
)
static-file.exclude-extensions = (
    ".pl",
    ".cgi",
    ".fcgi",
    ".php",
)
dir-listing.activate = "disable"
dir-listing.hide-dotfiles = "enable"
dir-listing.encoding = "utf-8"
dir-listing.exclude = (
    "^.",
    "~$",
    "favicon.ico",
    "robots.txt",
)
url.access-deny = (
    "~",
    ".ini",
    ".inc",
    ".cfg",
    ".tpl",
    ".bak",
    ".dist",
    ".orig",
    ".htaccess",
    ".htpasswd",
    ".example",
    ".sample",
    ".lang",
)
fastcgi.server = (
    ".php" => (
        (
            "socket" => "/tmp/php.socket",
            "bin-path" => "/usr/bin/php5-cgi",
            "bin-environment" => (
                "PHP_FCGI_CHILDREN" => "32",
                "PHP_FCGI_MAX_REQUESTS" => "500",
            ),
            "bin-copy-environment" => (
                "PATH",
                "SHELL",
                "USER",
            ),
            "broken-scriptfilename" => "enable",
        ),
    ),
)
cgi.assign = (
    ".pl" => "/usr/bin/perl",
    ".cgi" => "/usr/bin/perl",
)
ssi.extension = (
    ".shtml",
)
#compress.cache-dir = "/var/tmp/lighttpd/cache/compress/"
#compress.filetype = (
#    "text/javascript",
#    "text/plain",
#    "text/html",
#    "text/css",
#    "text/xml",
#)
status.status-url = "/server-status"
#status.config-url = "/server-config"
accesslog.filename = "/var/log/lighttpd/access.log"
accesslog.format = "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i""
$HTTP["url"] =~ ".pdf$" {
    server.range-requests = "disable"
}
include "world-of-smilies.com.conf"
include "pictransfer.de.conf"
include "besucherstats.de.conf"
include "4rm.de.conf"
include "newsoase.de.conf"
include "domains.conf"
include "webmasterscene.de.conf"
include "netdieb.de.conf"
include "emailtauschen.de.conf"
include "machowitze.de.conf"
include "ji1.de.conf"
include "spiele4free.de.conf"
include "voten.biz.conf"
include "gutpokern.de.conf"
include "popstars-monrose.de.conf"
include "send4free.de.conf"

APC sollte SHM nutzen:

Code: Select all

extension=apc.so
apc.enabled="1"
apc.shm_segments="1"
apc.shm_size="30"
apc.optimization="0"
apc.num_files_hint="1024"
apc.ttl="7200"
apc.user_ttl="7200"
apc.gc_ttl="3600"
apc.cache_by_default="1"
apc.mmap_file_mask="/apc.shm.XXXXXX"
apc.file_update_protection="2"
apc.enable_cli="0"
apc.max_file_size="1M"
apc.stat="1"
apc.write_lock="1"

HTH

malo
Posts: 61
Joined: 2005-01-03 22:40

Re: Webserver (lighty) tunen - Langsam zu hochzeiten :(

Post by malo » 2007-08-30 18:39

mccab99 wrote:Machst du einmal ein "top -u www-data"?

Die Anzahl der php5-cgi-Prozesse kommt mir - falls das ein top-Snapshot zur "Hochzeit" ist, recht klein vor.

Maik


hi hier der auszug jetzt (18:40) (das sind noch mehr, aber mehr werden nicht angezeigt auf einmal

Code: Select all

top - 18:39:38 up 1 day, 11:11,  1 user,  load average: 0.13, 0.26, 0.31
Tasks: 377 total,   1 running, 376 sleeping,   0 stopped,   0 zombie
Cpu(s):  9.1%us,  1.6%sy,  0.0%ni, 83.4%id,  3.0%wa,  0.8%hi,  2.2%si,  0.0%st
Mem:   2076000k total,  1949380k used,   126620k free,    78468k buffers
Swap:  2096440k total,       60k used,  2096380k free,  1292508k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
16903 www-data  15   0 63184  57m  972 D  3.9  2.8  20:34.97 lighttpd
19052 www-data  17   0 23536 7976 5132 S  1.9  0.4   0:26.95 php5-cgi
23467 www-data  20   0 23516 7828 5040 S  1.9  0.4   0:11.89 php5-cgi
25620 www-data  16   0 23500 7660 4888 S  1.9  0.4   0:02.55 php5-cgi
16908 www-data  25   0 21564 6992 4632 S  0.0  0.3   0:00.08 php5-cgi
16909 www-data  25   0 21564 6992 4632 S  0.0  0.3   0:00.05 php5-cgi
16910 www-data  25   0 21564 6996 4632 S  0.0  0.3   0:00.06 php5-cgi
16911 www-data  25   0 21564 6992 4632 S  0.0  0.3   0:00.04 php5-cgi
16912 www-data  25   0 21568 6996 4632 S  0.0  0.3   0:00.04 php5-cgi
16913 www-data  18   0 23292 5344 2856 S  0.0  0.3   0:00.00 php5-cgi
16914 www-data  18   0 21484 5168 2696 S  0.0  0.2   0:00.00 php5-cgi
16915 www-data  18   0 21304 4528 2148 S  0.0  0.2   0:00.00 php5-cgi
16916 www-data  18   0 23304 5352 2856 S  0.0  0.3   0:00.01 php5-cgi
16917 www-data  16   0 23436 7116 4436 S  0.0  0.3   0:00.02 php5-cgi
16918 www-data  17   0 21452 6200 3716 S  0.0  0.3   0:00.01 php5-cgi
16919 www-data  16   0 21596 6948 4288 S  0.0  0.3   0:00.03 php5-cgi
16920 www-data  16   0 23444 6760 4160 S  0.0  0.3   0:00.02 php5-cgi
16921 www-data  18   0 23292 5484 2960 S  0.0  0.3   0:00.01 php5-cgi
16922 www-data  18   0 23328 5512 2980 S  0.0  0.3   0:00.01 php5-cgi
16923 www-data  18   0 23416 6316 3720 S  0.0  0.3   0:00.03 php5-cgi
16924 www-data  16   0 23444 6788 4136 S  0.0  0.3   0:00.04 php5-cgi
16925 www-data  16   0 23332 5500 2964 S  0.0  0.3   0:00.02 php5-cgi
16926 www-data  16   0 23288 5500 2976 S  0.0  0.3   0:00.01 php5-cgi
16927 www-data  25   0 21564 6996 4632 S  0.0  0.3   0:00.05 php5-cgi
16928 www-data  18   0 23448 7164 4472 S  0.0  0.3   0:00.06 php5-cgi
16929 www-data  16   0 23420 6908 4228 S  0.0  0.3   0:00.06 php5-cgi
16930 www-data  16   0 23440 7188 4500 S  0.0  0.3   0:00.05 php5-cgi
16931 www-data  15   0 21616 7160 4468 S  0.0  0.3   0:00.07 php5-cgi
16932 www-data  16   0 23340 6152 3628 S  0.0  0.3   0:00.00 php5-cgi
16933 www-data  18   0 23292 5368 2856 S  0.0  0.3   0:00.01 php5-cgi
16934 www-data  18   0 23436 7036 4364 S  0.0  0.3   0:00.02 php5-cgi
16935 www-data  16   0 21484 5416 2928 S  0.0  0.3   0:00.00 php5-cgi
16936 www-data  16   0 23436 7056 4392 S  0.0  0.3   0:00.02 php5-cgi
16937 www-data  18   0 21484 5160 2696 S  0.0  0.2   0:00.00 php5-cgi
16938 www-data  22   0 21432 4584 2168 S  0.0  0.2   0:00.00 php5-cgi
16939 www-data  18   0 21492 5188 2700 S  0.0  0.2   0:00.00 php5-cgi
16940 www-data  18   0 21412 4628 2172 S  0.0  0.2   0:00.00 php5-cgi
16942 www-data  18   0 21552 6236 3632 S  0.0  0.3   0:00.02 php5-cgi
16943 www-data  18   0 21480 5196 2700 S  0.0  0.3   0:00.00 php5-cgi
16944 www-data  15   0 21552 5704 3120 S  0.0  0.3   0:00.02 php5-cgi
16945 www-data  16   0 21596 6972 4316 S  0.0  0.3   0:00.02 php5-cgi
16946 www-data  18   0 21552 6248 3632 S  0.0  0.3   0:00.02 php5-cgi
16947 www-data  18   0 23292 5380 2856 S  0.0  0.3   0:00.01 php5-cgi
16948 www-data  18   0 23332 5520 2976 S  0.0  0.3   0:00.02 php5-cgi
16949 www-data  16   0 23436 6816 4120 S  0.0  0.3   0:00.04 php5-cgi
16950 www-data  18   0 23332 5468 2960 S  0.0  0.3   0:00.01 php5-cgi
16951 www-data  18   0 21536 6440 3836 S  0.0  0.3   0:00.02 php5-cgi
16952 www-data  15   0 23448 7428 4736 S  0.0  0.4   0:00.25 php5-cgi
16953 www-data  18   0 23428 7264 4568 S  0.0  0.3   0:00.16 php5-cgi
16954 www-data  16   0 23480 7532 4804 S  0.0  0.4   0:00.30 php5-cgi
16955 www-data  16   0 23456 7312 4596 S  0.0  0.4   0:00.20 php5-cgi
16956 www-data  16   0 23440 7184 4544 S  0.0  0.3   0:00.06 php5-cgi
16957 www-data  15   0 23420 6668 4056 S  0.0  0.3   0:00.04 php5-cgi