Vserver seit einigen Tagen sehr langsam

Servix

New Member
Hallöchen, ich habe einen Vserver bei S4Y und seit 3-4 Tagen ist der Server erheblich langsamer.

Ich habe sehr viele Domains die alle auf den Server leiten - aber fast alle auf eine Standardseite leiten. Außerdem läuft noch Mysql.

Ich kann mir nicht erklären, wieso die Seite seit einigen Tagen deutlich langsamer läuft, ich hatte testweise zwar mal einen Shoutcastserver installiert, da scheint aber nichts mehr aktiv zu laufen.

Hier schonmal die laufenden Prozesse:

Code:
top - 18:52:29 up 17 min,  1 user,  load average: 0.59, 0.40, 0.23
Tasks:  61 total,   1 running,  60 sleeping,   0 stopped,   0 zombie
Cpu(s):  1.3%us,  0.2%sy,  0.0%ni, 98.5%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   2097152k total,  1161864k used,   935288k free,        0k buffers
Swap:        0k total,        0k used,        0k free,        0k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1448 www-data  16   0  257m  20m 4116 S   12  1.0   0:03.87 apache2
 1973 mysql     15   0  226m  41m 7444 S    9  2.0   0:34.76 mysqld
    1 root      15   0  8364  804  680 S    0  0.0   0:02.56 init
 1331 root      18   0 53608  960  464 S    0  0.0   0:00.00 saslauthd
 1340 root      15   0  5988  688  540 S    0  0.0   0:00.05 syslogd
 1352 bind      24   0  360m  36m 2500 S    0  1.8   0:02.13 named
 1380 root      18   0  247m  12m 6708 S    0  0.6   0:00.05 apache2
 1383 www-data  18   0  186m 3972  624 S    0  0.2   0:00.00 apache2
 1627 www-data  15   0  257m  20m 4108 S    0  1.0   0:11.75 apache2
 1628 www-data  15   0  257m  19m 4064 S    0  1.0   0:00.42 apache2
 1629 www-data  15   0  257m  20m 4128 S    0  1.0   0:00.62 apache2
 1630 www-data  15   0  254m  17m 4156 S    0  0.9   0:07.98 apache2
 1631 www-data  15   0  253m  16m 4084 S    0  0.8   0:00.54 apache2
 1632 www-data  15   0  257m  19m 4076 S    0  1.0   0:00.56 apache2
 1633 www-data  18   0  256m  19m 4148 S    0  0.9   0:04.01 apache2
 1634 clamav    25   0  192m 136m  536 S    0  6.7   0:00.00 clamd
 1731 clamav    20   0 38500 1720  924 S    0  0.1   0:01.27 freshclam
 1751 root      18   0 22436 1064  816 S    0  0.1   0:00.00 cron
 1761 root      15   0  191m 8128 2228 S    0  0.4   0:00.22 fail2ban-server
 1824 www-data  15   0  256m  19m 4072 S    0  0.9   0:00.42 apache2
 1825 www-data  18   0  257m  19m 4076 S    0  1.0   0:00.67 apache2
 1826 list      25   0 53644 8048  864 S    0  0.4   0:00.00 mailmanctl
 1827 list      18   0 45048 9.9m 2996 S    0  0.5   0:00.09 python
 1828 list      18   0 45116   9m 3004 S    0  0.5   0:00.09 python
 1829 list      18   0 45052 9.9m 2996 S    0  0.5   0:00.10 python
 1830 list      18   0 45052 9.9m 2996 S    0  0.5   0:00.10 python
 1831 list      15   0 45108   9m 2996 S    0  0.5   0:00.09 python
 1832 list      18   0 45424  10m 3004 S    0  0.5   0:00.09 python
 1833 list      18   0 45052 9.9m 2996 S    0  0.5   0:00.09 python
 1834 list      18   0 45048 9.9m 2996 S    0  0.5   0:00.07 python
 1859 root      18   0  3960  632  508 S    0  0.0   0:00.00 mysqld_safe
 1974 root      18   0  3860  616  524 S    0  0.0   0:00.00 logger
 2021 root      18   0 39056  852  528 S    0  0.0   0:00.00 dovecot
 2022 root      15   0 75024 3292 2468 S    0  0.2   0:00.00 dovecot-auth
 2033 root      20   0 74892 3144 2404 S    0  0.1   0:00.00 dovecot-auth
 3086 proftpd   18   0 90260 1936  624 S    0  0.1   0:00.00 proftpd
 3131 root      15   0  115m  49m 2392 S    0  2.4   0:01.99 spamd
 3165 dovecot   15   0 36908 2560 2016 S    0  0.1   0:00.00 pop3-login
 3166 dovecot   20   0 36908 2560 2016 S    0  0.1   0:00.00 pop3-login
 3167 dovecot   21   0 36908 2560 2016 S    0  0.1   0:00.00 pop3-login
 3168 dovecot   22   0 36920 2564 2016 S    0  0.1   0:00.00 imap-login
 3169 dovecot   23   0 36920 2564 2016 S    0  0.1   0:00.00 imap-login
 3170 dovecot   24   0 36920 2564 2016 S    0  0.1   0:00.00 imap-login
 3180 root      18   0  115m  48m  616 S    0  2.4   0:00.00 spamd
 3182 root      18   0  115m  48m  616 S    0  2.4   0:00.00 spamd

Und hier die User-Beancounters:
Code:
Version: 2.5
       uid  resource                     held              maxheld              barrier                limit              failcnt
 10011468:  kmemsize                 22119260             45493109             49029120             54476800                    0
            lockedpages                     0                  465                  860                  860                   69
            privvmpages                291186               551595               524288               550502               374035
            shmpages                     1082                12506                32768                32768                    3
            dummy                           0                    0  9223372036854775807  9223372036854775807                    0
            numproc                       107                  219                  256                  256                    0
            physpages                  135285               375887                    0  9223372036854775807                    0
            vmguarpages                     0                    0               262144  9223372036854775807                    0
            oomguarpages               135285               375887               262144  9223372036854775807                    0
            numtcpsock                    168                  379                 1200                 1200                    0
            numflock                       45                   97                  224                  246                    0
            numpty                          1                   13                   32                   32                    0
            numsiginfo                      0                   69                  512                  512                    0
            tcpsndbuf                  617672              3919408              4942675              7056211              3207743
            tcprcvbuf                  862984              4948664              4942675              7056211                    2
            othersockbuf               273120               744616               744366              1481926               250575
            dgramrcvbuf                     0               485736               844366               844366                    0
            numothersock                  154                  439                 1200                 1200                20580
            dcachesize                1328685              1740906              7299072              8110080                    0
            numfile                      3776                 6000                 6000                 6000               284576
            dummy                           0                    0                    0                    0                    0
            dummy                           0                    0                    0                    0                    0
            dummy                           0                    0                    0                    0                    0
            numiptent                      43                   58                   96                   96                    0

Wäre nett, wenn Ihr mir helfen könntet, das Problem einzugrenzen.

Danke.

:)
 
Ich weiß nicht wie dir hier jemand helfen soll. Es klingt etwas danach, als wäre der Host etwas stärker belastet als sonst. Sei es um die Gewinnmage bei V-Servern zu erhöhen oder aufgrund eines Kunden, der etwas I/O / Systemlastigere Prozesse betreibt.
 
Danke für die Antwort, es hätte ja sein können, dass ich irgendwas übersehen habe und quasi "Schuld" bin, mal schauen was der Anbieter sagt.:cool:
 
Deine Failcounter sagen auch eigentlich recht eindeutig, dass du in Sachen RAM sowie zB Anzahl Sockets deine Ressourcen schon stark überschreitest.
 
Falls es wirklich zu I/O Problemen kommen sollte, würde das in deinem Top auffallen. Der Punkt wa zeigt in deiner Ausgabe aber 0% an.

Bei OpenVZ Systemen ist deine user_beancounters aber das bevorzugte Mittel zur Ressourcenüberprüfung, da die anderen Werte aufgrund der Virtualisierung nicht eindeutig sein können.

Wie mein Vorredner bereits sagte, hast du ein Problem mit deinem RAM und den Sockets. Überprüfe bitte deine Log Dateien vom Webserver und zeige mal die Prefork / Worker Konfiguration ( /etc/apache2/apache2.conf ). Höchstwahrscheinlich ist dein Webserver nicht an die lokalen Ressourcen angepasst, sodass dein Apache mehr RAM/Sockets verbrauchen möchte, als zur Verfügung stehen.

Als Ergebnis arbeiten die Child Prozesse nicht korrekt und können deine Webseite nicht ausliefern.

Gruß
Nero
 
Danke für Eure Antworten und Hilfen.

Hier die Apache.conf - ich werde mal bisschen was ausprobieren, es verwundert mich halt, dass es erst seit wenigen Tagen zu Problemen kommt.

Code:
#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
#
# The configuration directives are grouped into three basic sections:
#  1. Directives that control the operation of the Apache server process as a
#     whole (the 'global environment').
#  2. Directives that define the parameters of the 'main' or 'default' server,
#     which responds to requests that aren't handled by a virtual host.
#     These directives also provide default values for the settings
#     of all virtual hosts.
#  3. Settings for virtual hosts, which allow Web requests to be sent to
#     different IP addresses or hostnames and have them handled by the
#     same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "foo.log"
# with ServerRoot set to "/etc/apache2" will be interpreted by the
# server as "/etc/apache2/foo.log".
#

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation (available
# at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
LockFile ${APACHE_LOCK_DIR}/accept.lock

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

##
## Server-Pool Size Regulation (MPM specific)
## 

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
    StartServers       1
    MinSpareServers    1
    MaxSpareServers    5
    MaxClients        10
    MaxRequestsPerChild   0
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
#              graceful restart. ThreadLimit can only be changed by stopping
#              and starting Apache.
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
    StartServers       1
    MinSpareThreads    1
    MaxSpareThreads    4
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients        10
    MaxRequestsPerChild   0
</IfModule>

# event MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_event_module>
    StartServers       1
    MaxClients        10
    MinSpareThreads    1
    MaxSpareThreads    4
    ThreadLimit          64
    ThreadsPerChild      25
    MaxRequestsPerChild   0
</IfModule>

# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#

AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being 
# viewed by Web clients. 
#
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy all
</Files>

#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value.  If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain


#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

# Include module configuration:
Include mods-enabled/*.load
Include mods-enabled/*.conf

# Include all the user configurations:
Include httpd.conf

# Include ports listing
Include ports.conf

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
Include conf.d/

# Include the virtual host configurations:
Include sites-enabled/
DocumentRoot /var/www
ServerPath /var/www

Habe jetzt die MaxClients auf 25 gesetzt, hilft aber auch nicht soooo besonders.

Langsam werde ich ratlos, Server wird trotz temporär gebuchtem Boost immer langsamer...

Noch Ideen? DANKE!
 
Last edited by a moderator:
Eine abschließende Zusatzfrage:

Da der Vserver offenbar wirklich an die Grenzen stößt, werde ich den Schritt eines weiteren Vollservers "wagen" - wie kann ich am besten zuvor abschätzen, welche Technik / Leistung für mich "mit Spielraum" nach oben ausreicht?

Möchte ungerne was "völlig überdimensioniertes" kaufen, aber es soll eine gute Performance bieten!

Ist ein Vserver von der Leistung überhaupt mit einem dedicated Server vergleichbar, wenn gewisse Grundwerte "zugesichert" sind? Bitte gegebenenfalls diesen Thread entsprechend verschieben. DANKE
 
Hallo Servix,

als erstes möchte ich noch etwas über deine apache2.conf sagen. Leider hast du mir noch nicht verraten, ob dein Webserver als Worker oder Prefork arbeitet, aber ich gehe jetzt einfach mal von einem Prefork aus.

Dein Parameter MaxRequestsPerChild steht auf 0. Dies kann ggf. bei Problemen im Quellcode zu Memleaks führen.

Um es etwas genauer zu erklären: Dein Quellcode reserviert Arbeitsspeicher u.a. für Variablen. Wenn dieser Speicher nicht wieder sauber freigegeben wird, passiert dies erst wenn der Prozess beendet ist. Nun sterben deine Childs niemals, sodass sich der Speicherverbrauch erhöhen kann.

Um dieses Problem vorzubeugen, sollten deine Childs nach einer gewissen Zahl von Anfragen sterben. Was man nun einträgt hängt von der Anwendung/Webseite und dem Server ab. Als Anfang würde ich bei einem vServer bei 400 starten. Das ganze kann ja in der Langzeitbeobachtung angepasst werden.


Zu deinen aktuellen Fragen:

Ein vServer teilt sich die Ressourcen des Hostsystems mit x anderen Kunden. Daher ist der unterschied zwischen einem vServer und einem dedizierten Rootserver im Punkt Performance mit unter massiv.

Wenn du sowieso bereits bei Server4you bist, versuch es doch mit dem kleinsten Rootserver EcoServer ENTRY X6.
Laut der Webseite kannst du den Server auch 30 Tage ohne Risiko testen.

Das sollte schon ein Unterschied wie Tag und Nacht sein. ;)

Beachten solltest du aber unbedingt, dass du die Festplatten und das Software RAID überwachst. Was nützt einen das RAID 1, wenn ein Ausfall nicht auffällt und der Server so lange weiter läuft, bis auch die 2. Festplatte die Verschleiß-Grenze erreicht hat.

Gruß
Nero
 
Danke für Deine ausführliche Antwort.

Ich denke Du hast mir den Anstoß zur Lösung des Problems gegeben.

Dein Parameter MaxRequestsPerChild steht auf 0. Dies kann ggf. bei Problemen im Quellcode zu Memleaks führen. -> Ich denke, dass genau das der Grund war, da nach Überarbeitung der Standardwebseite, die meist geladen wird und nach Reboot jetzt die Webseiten wieder in akzeptabler Geschwindigkeit laden.

Der "Boost" ist zwar noch aktiviert, ich werde aber versuchen, den wieder zurückzusetzen und bisschen zu beobachten.

Danke!
 
Back
Top