Wordpress | CPU ausgelastet

mattla93

New Member
Hallo, habe ein Problem. Wollte eine Homepage auf einen vServer hochladen. Die Datenbanken sind schon etwas größer. Die gzip-Export Datei ist ca. 10MB groß.

Die Seite braucht für den Seitenaufbau extrem lange. Die CPU ist dabei laut Parallels Business Automation über 100% ausgelastet. Der Server hat 2,7GHz.
Ist der Profi hier:

Auch die Datenbanken dauern extrem lang zum laden. Komplett die selbe Datenbank und der selbe Space laufen aber auf einen anderen Server flüssig, mit ca. der selben(schwächeren) Hardware.

Am Server wurde rein GAR NICHTS noch geändert, da ich die Performance des Blogs testen wollte. Also nur die Domain via Confixx Angelegt und Dateien und Datenbank übertragen

Kann mir jemand helfen?

Hier noch die generierten SQL-Befehle, von Wordpress:
Code:
<!--
20 queries. 8.040 seconds.
array(20) {
  [0]=>
  array(3) {
    [0]=>
    string(71) "SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes'"
    [1]=>
    float(0.338349819183)
    [2]=>
    string(88) "require, require_once, require_once, require_once, is_blog_installed, wp_load_alloptions"
  }
  [1]=>
  array(3) {
    [0]=>
    string(49) "SELECT * FROM wp_users WHERE user_login = 'admin'"
    [1]=>
    float(0.0504579544067)
    [2]=>
    string(160) "require, require_once, require_once, require_once, WP->init, wp_get_current_user, get_currentuserinfo, wp_validate_auth_cookie, get_userdatabylogin, get_user_by"
  }
  [2]=>
  array(3) {
    [0]=>
    string(62) "SELECT meta_key, meta_value FROM wp_usermeta WHERE user_id = 1"
    [1]=>
    float(0.0133190155029)
    [2]=>
    string(172) "require, require_once, require_once, require_once, WP->init, wp_get_current_user, get_currentuserinfo, wp_validate_auth_cookie, get_userdatabylogin, get_user_by, _fill_user"
  }
  [3]=>
  array(3) {
    [0]=>
    string(257) " SELECT   wp_posts.* FROM wp_posts  WHERE 1=1  AND YEAR(wp_posts.post_date)='2010' AND MONTH(wp_posts.post_date)='1' AND wp_posts.post_name = 'neuer-status-und-neuer-name-fur-ibluetooth-2-0' AND wp_posts.post_type = 'post'  ORDER BY wp_posts.post_date DESC "
    [1]=>
    float(0.0154850482941)
    [2]=>
    string(76) "require, wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts"
  }
  [4]=>
  array(3) {
    [0]=>
    string(286) "SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category', 'post_tag') AND tr.object_id IN (5219) ORDER BY t.name ASC"
    [1]=>
    float(0.026654958725)
    [2]=>
    string(143) "require, wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts, update_post_caches, update_object_term_cache, wp_get_object_terms"
  }
  [5]=>
  array(3) {
    [0]=>
    string(77) "SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (5219)"
    [1]=>
    float(0.0151710510254)
    [2]=>
    string(138) "require, wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts, update_post_caches, update_postmeta_cache, update_meta_cache"
  }
  [6]=>
  array(3) {
    [0]=>
    string(173) " SELECT SQL_CALC_FOUND_ROWS  wp_posts.* FROM wp_posts  WHERE 1=1  AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish')  ORDER BY wp_posts.ID ASC LIMIT 0, 1"
    [1]=>
    float(0.166357040405)
    [2]=>
    string(247) "require, require_once, include, get_header, locate_template, load_template, require_once, wp_head, do_action, call_user_func_array, start_post_rel_link, get_boundary_post_rel_link, get_boundary_post, get_posts, WP_Query->query, WP_Query->get_posts"
  }
  [7]=>
  array(3) {
    [0]=>
    string(19) "SELECT FOUND_ROWS()"
    [1]=>
    float(0.163440942764)
    [2]=>
    string(247) "require, require_once, include, get_header, locate_template, load_template, require_once, wp_head, do_action, call_user_func_array, start_post_rel_link, get_boundary_post_rel_link, get_boundary_post, get_posts, WP_Query->query, WP_Query->get_posts"
  }
  [8]=>
  array(3) {
    [0]=>
    string(283) "SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category', 'post_tag') AND tr.object_id IN (3) ORDER BY t.name ASC"
    [1]=>
    float(0.125754117966)
    [2]=>
    string(314) "require, require_once, include, get_header, locate_template, load_template, require_once, wp_head, do_action, call_user_func_array, start_post_rel_link, get_boundary_post_rel_link, get_boundary_post, get_posts, WP_Query->query, WP_Query->get_posts, update_post_caches, update_object_term_cache, wp_get_object_terms"
  }
  [9]=>
  array(3) {
    [0]=>
    string(74) "SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (3)"
    [1]=>
    float(0.084892988205)
    [2]=>
    string(309) "require, require_once, include, get_header, locate_template, load_template, require_once, wp_head, do_action, call_user_func_array, start_post_rel_link, get_boundary_post_rel_link, get_boundary_post, get_posts, WP_Query->query, WP_Query->get_posts, update_post_caches, update_postmeta_cache, update_meta_cache"
  }
  [10]=>
  array(3) {
    [0]=>
    string(162) "SELECT p.* FROM wp_posts AS p  WHERE p.post_date < '2010-01-09 12:03:50' AND p.post_type = 'post' AND p.post_status = 'publish'  ORDER BY p.post_date DESC LIMIT 1"
    [1]=>
    float(0.0221221446991)
    [2]=>
    string(202) "require, require_once, include, get_header, locate_template, load_template, require_once, wp_head, do_action, call_user_func_array, adjacent_posts_rel_link, get_adjacent_post_rel_link, get_adjacent_post"
  }
  [11]=>
  array(3) {
    [0]=>
    string(161) "SELECT p.* FROM wp_posts AS p  WHERE p.post_date > '2010-01-09 12:03:50' AND p.post_type = 'post' AND p.post_status = 'publish'  ORDER BY p.post_date ASC LIMIT 1"
    [1]=>
    float(0.0552749633789)
    [2]=>
    string(202) "require, require_once, include, get_header, locate_template, load_template, require_once, wp_head, do_action, call_user_func_array, adjacent_posts_rel_link, get_adjacent_post_rel_link, get_adjacent_post"
  }
  [12]=>
  array(3) {
    [0]=>
    string(106) "SELECT * FROM wp_posts  WHERE (post_type = 'page' AND post_status = 'publish')     ORDER BY menu_order ASC"
    [1]=>
    float(0.045166015625)
    [2]=>
    string(114) "require, require_once, include, get_header, locate_template, load_template, require_once, wp_list_pages, get_pages"
  }
  [13]=>
  array(3) {
    [0]=>
    string(44) "SELECT * FROM wp_users WHERE ID = 15 LIMIT 1"
    [1]=>
    float(0.0632801055908)
    [2]=>
    string(90) "require, require_once, include, the_post, WP_Query->the_post, setup_postdata, get_userdata"
  }
  [14]=>
  array(3) {
    [0]=>
    string(63) "SELECT meta_key, meta_value FROM wp_usermeta WHERE user_id = 15"
    [1]=>
    float(0.00949382781982)
    [2]=>
    string(102) "require, require_once, include, the_post, WP_Query->the_post, setup_postdata, get_userdata, _fill_user"
  }
  [15]=>
  array(3) {
    [0]=>
    string(157) "SELECT * FROM wp_comments WHERE comment_post_ID = 5219 AND (comment_approved = '1' OR ( user_id = 1 AND comment_approved = '0' ) )  ORDER BY comment_date_gmt"
    [1]=>
    float(0.0790917873383)
    [2]=>
    string(49) "require, require_once, include, comments_template"
  }
  [16]=>
  array(3) {
    [0]=>
    string(193) "SELECT wp_comments.* FROM wp_comments JOIN wp_posts ON wp_posts.ID = wp_comments.comment_post_ID WHERE comment_approved = '1' AND post_status = 'publish' ORDER BY comment_date_gmt DESC LIMIT 15"
    [1]=>
    float(0.043851852417)
    [2]=>
    string(192) "require, require_once, include, get_sidebar, locate_template, load_template, require_once, dynamic_sidebar, call_user_func_array, WP_Widget->display_callback, WP_Widget_Recent_Comments->widget"
  }
  [17]=>
  array(3) {
    [0]=>
    string(151) "SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('category')  ORDER BY t.name ASC "
    [1]=>
    float(0.0447587966919)
    [2]=>
    string(136) "require, require_once, include, get_sidebar, locate_template, load_template, require_once, wp_list_categories, get_categories, get_terms"
  }
  [18]=>
  array(3) {
    [0]=>
    string(86) "SELECT *    FROM wp_links  WHERE 1=1 AND link_visible = 'Y'     ORDER BY link_name ASC"
    [1]=>
    float(0.0254728794098)
    [2]=>
    string(122) "require, require_once, include, get_footer, locate_template, load_template, require_once, wp_list_bookmarks, get_bookmarks"
  }
  [19]=>
  array(3) {
    [0]=>
    string(226) "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM wp_posts  WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC  LIMIT 12"
    [1]=>
    float(0.0424180030823)
    [2]=>
    string(105) "require, require_once, include, get_footer, locate_template, load_template, require_once, wp_get_archives"
  }
}
--!>
 
Was sagt denn eine Ausgabe von
Code:
cat /proc/user_beancounter
Steht etwas in den Logfiles?
 
Was sagt denn eine Ausgabe von
Code:
cat /proc/user_beancounter
Steht etwas in den Logfiles?

Code:
Version: 2.5
       uid  resource           held    maxheld    barrier      limit    failcnt
     ##:  kmemsize        4119941    4144435 2147483647 2147483647          0
            lockedpages           0          0 2147483647 2147483647          0
            privvmpages       90554      90576 2147483647 2147483647          0
            shmpages           1422       1422 2147483647 2147483647          0
            dummy                 0          0 2147483647 2147483647          0
            numproc              51         51 2147483647 2147483647          0
            physpages         17172      17176 2147483647 2147483647          0
            vmguarpages           0          0 2147483647 2147483647          0
            oomguarpages      17172      17176 2147483647 2147483647          0
            numtcpsock           19         19 2147483647 2147483647          0
            numflock              8          8 2147483647 2147483647          0
            numpty                1          1 2147483647 2147483647          0
            numsiginfo            0          0 2147483647 2147483647          0
            tcpsndbuf        185588     185588 2147483647 2147483647          0
            tcprcvbuf        311296     311296 2147483647 2147483647          0
            othersockbuf      69316      69316 2147483647 2147483647          0
            dgramrcvbuf           0          0 2147483647 2147483647          0
            numothersock         40         40 2147483647 2147483647          0
            dcachesize       519347     520940 2147483647 2147483647          0
            numfile            1997       1998 2147483647 2147483647          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            numiptent            14         14 2147483647 2147483647          0

In den logfiles fiel mir eigentlich nichts auffälliges auf.
 
Last edited by a moderator:
Naja, Apache, PHP und MySQL optimieren sollte man immer.
Zusätzlich würde ich dir noch zu einem externen PHP-Cache raten, z.b. eaccelerator.
Erste Anlaufstelle wäre für mich php.ini, wenn dort der default Wert von 8 (bzw. 16) MB bei memory_limit zu wenig ist (was bei modernen CMS oft der fall ist) bremst das schon ungeheuer....meine CMS Site (mittlerweile ca. 110MB Datenbank) fluppt erst bei min. 32MB so richtig gut. Aber das ist natürlich nur erstmal ein Schuss ins Blaue und ersetzt keine allgemeine Optimierung.

Und Confixx...naja, da bleibe ich lieber Gentleman und sage nix, ich bin mit einer OS Minimalinstallation und anschliessender manuellen Installation von VHCS2 jedenfalls WEIT glücklicher als früher mit Confixx.
 
VHCS2 würde ich ja nicht mehr guten Gewissens empfehlen, so ohne Updates und Sicherheitspatches. Vorallem weil es mod_php verwendet und somit alle User die gleichen Rechte haben. Wenn schon neuinstallieren dann bitte mit ISPCP.
 
VHCS2 würde ich ja nicht mehr guten Gewissens empfehlen, so ohne Updates und Sicherheitspatches. Vorallem weil es mod_php verwendet und somit alle User die gleichen Rechte haben. Wenn schon neuinstallieren dann bitte mit ISPCP.

Auf einem Server hatte ich auch VHCS, war sehr glücklich. Aber Confixx finde ich besser :). Zumal sollten die 2,6 GHz soch genug sein, dass Confixx auch läuft

Aber extrem lang dauern die SQL-Abfragen.

Hier eine URL zu Wordpress. Im Quellcode ganz unten sieht man die Zeit, der SQL-Querys.
http://bit.ly/6mWu3t

HTML funktioniert hingegen schneller:
http://bit.ly/4PutYI
(ja, ist selfphp auf meinem lokalen Space. wusste nicht mit was sonst testen ;)
 
Dann solltest du mal versuchen den Mysql Server zu optimieren.

Zu VHCS alleine der mitgelieferte FTP Webclient enthält mehr Exploits als einem lieb ist. Genauso sieht es mit dem Webmailclient und der PMA Version aus. Wenn du das nicht manuell Updatest ist schon mal schicht im Schacht. Was VHCS selber für Sicherheitslücken enthält will ich garnicht wissen ;)
 
Erste Anlaufstelle wäre für mich php.ini, wenn dort der default Wert von 8 (bzw. 16) MB bei memory_limit ...fluppt erst bei min. 32MB so richtig gut. Aber das ist natürlich nur erstmal ein Schuss ins Blaue und ersetzt keine allgemeine Optimierung.

Der ist schon auf 128MB eingestellt.
 
Dann solltest du mal versuchen den Mysql Server zu optimieren.

Da ist meine my.conf:

Code:
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
# 
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port		= 3306
socket		= /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket		= /var/run/mysqld/mysqld.sock
nice		= 0

[mysqld]
#
# * Basic Settings
#
user		= mysql
pid-file	= /var/run/mysqld/mysqld.pid
socket		= /var/run/mysqld/mysqld.sock
port		= 3306
basedir		= /usr
datadir		= /var/lib/mysql
tmpdir		= /tmp
language	= /usr/share/mysql/english
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address		= 127.0.0.1
#
# * Fine Tuning
#
key_buffer = 256M
myisam_sort_buffer_size = 64M
read_buffer_size = 2M
read_rnd_buffer_size = 4M
max_allowed_packet	= 16M
thread_stack		= 128K
thread_cache=64
thread_cache_size	= 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover		= BACKUP
#max_connections        = 100
#table_cache            = 64
#thread_concurrency     = 10
#
# * Query Cache Configuration
#
query_cache_limit       = 1M
query_cache_size        = 32M
query_cache_type = 1
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
#log		= /var/log/mysql/mysql.log
#
# Error logging goes to syslog. This is a Debian improvement :)
#
# Here you can see queries with especially long duration
#log_slow_queries	= /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id		= 1
#log_bin			= /var/log/mysql/mysql-bin.log
expire_logs_days	= 10
max_binlog_size         = 100M
#binlog_do_db		= include_database_name
#binlog_ignore_db	= include_database_name
#
# * BerkeleyDB
#
# Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.
skip-bdb
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
# You might want to disable InnoDB to shrink the mysqld process by circa 100MB.
#skip-innodb
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet	= 16M

[mysql]
#no-auto-rehash	# faster start of mysql but no tab completition

[isamchk]
key_buffer		= 16M

#
# * NDB Cluster
#
# See /usr/share/doc/mysql-server-*/README.Debian for more information.
#
# The following configuration is read by the NDB Data Nodes (ndbd processes)
# not from the NDB Management Nodes (ndb_mgmd processes).
#
# [MYSQL_CLUSTER]
# ndb-connectstring=127.0.0.1


#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
Dann noch das mySql Tuning Analyzer Tool:
Code:
        -- MYSQL PERFORMANCE TUNING PRIMER --
             - By: Matthew Montgomery -

MySQL Version 5.0.51a-24+lenny2 i486

Uptime = 0 days 0 hrs 6 min 2 sec
Avg. qps = 1
Total Questions = 603
Threads Connected = 1

Warning: Server has not been running for at least 48hrs.
It may not be safe to use these recommendations

To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html
Visit http://www.mysql.com/products/enterprise/advisors.html
for info about MySQL's Enterprise Monitoring and Advisory Service

SLOW QUERIES
The slow query log is NOT enabled.
Current long_query_time = 10 sec.
You have 0 out of 624 that take longer than 10 sec. to complete
Your long_query_time seems to be fine

BINARY UPDATE LOG
The binary update log is NOT enabled.
You will not be able to do point in time recovery
See http://dev.mysql.com/doc/refman/5.0/en/point-in-time-recovery.html

WORKER THREADS
Current thread_cache_size = 8
Current threads_cached = 2
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS
Current max_connections = 100
Current threads_connected = 1
Historic max_used_connections = 3
The number of used connections is 3% of the configured maximum.
You are using less than 10% of your configured max_connections.
Lowering max_connections could help to avoid an over-allocation of memory
See "MEMORY USAGE" section to make sure you are not over-allocating

INNODB STATUS
Current InnoDB index space = 0 bytes
Current InnoDB data space = 0 bytes
Current InnoDB buffer pool free = 96 %
Current innodb_buffer_pool_size = 8 M
Depending on how much space your innodb indexes take up it may be safe
to increase this value to up to 2 / 3 of total system memory

MEMORY USAGE
Max Memory Ever Allocated : 322 M
Configured Max Per-thread Buffers : 824 M
Configured Max Global Buffers : 298 M
Configured Max Memory Limit : 1.09 G
Physical Memory : 2.00 G
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 1 M
Current key_buffer_size = 256 M
Key cache miss rate is 1 : 11
Key buffer free ratio = 88 %
Your key_buffer_size seems to be fine

QUERY CACHE
Query cache is enabled
Current query_cache_size = 32 M
Current query_cache_used = 222 K
Current query_cache_limit = 1 M
Current Query cache Memory fill ratio = .67 %
Current query_cache_min_res_unit = 4 K
Your query_cache_size seems to be too high.
Perhaps you can use these resources elsewhere
MySQL won't cache query results that are larger than query_cache_limit in size

SORT OPERATIONS
Current sort_buffer_size = 2 M
Current read_rnd_buffer_size = 3 M
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 132.00 K
You have had 0 queries where a join could not use an index properly
Your joins seem to be using indexes properly

OPEN FILES LIMIT
Current open_files_limit = 1024 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
Your open_files_limit value seems to be fine

TABLE CACHE
Current table_cache value = 64 tables
You have a total of 162 tables
You have 64 open tables.
Current table_cache hit rate is 4%
, while 100% of your table cache is in use
You should probably increase your table_cache

TEMP TABLES
Current max_heap_table_size = 16 M
Current tmp_table_size = 32 M
Of 250 temp tables, 14% were created on disk
Effective in-memory tmp_table_size is limited to max_heap_table_size.
Created disk tmp tables ratio seems fine

TABLE SCANS
Current read_buffer_size = 1 M
Current table scan ratio = 7 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 0 : 879
Your table locking seems to be fine
Was sollte ich ändrn, optimieren?
 
Last edited by a moderator:
So, konnte jetzt die Datenbank einigermaßen gut optimieren. Läuft jetzt auch stabil. Jetzt mach ich mich noch an apache dran. Das soll schließlich auch schnell laufen :)

Einige fragen habe ich noch. Die tunig-primer.sh meldet noch einige Fehler. Wie kann ich die beheben:

Problem 1:
Code:
MAX CONNECTIONS
Current max_connections = 30
Current threads_connected = 1
Historic max_used_connections = 3
The number of used connections is 10% of the configured maximum.
You are using less than 10% of your configured max_connections.
Lowering max_connections could help to avoid an over-allocation of memory
[COLOR="Red"]See "MEMORY USAGE" section to make sure you are not over-allocating[/COLOR]

Problem 2
Code:
MySQL won't cache query results that are larger than query_cache_limit in size

Problem 3:
Code:
OPEN FILES LIMIT
Current open_files_limit = 1064 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
Your open_files_limit value seems to be fine
 
Vielen Dank für eure Hilfe, konnte jetzt die Server alle so einstellen, dass es akzeptabel für mich ist. Werde vom Speed her aber sicherlich noch was machen können.

Seite jetzt:
http://bit.ly/1FLkDV

Ich habe jedoch noch ein paar fragen.
top erzeugt folgende Ausgabe:
Code:
top - 13:00:22 up 15:49,  0 users,  load average: 0.00, 0.00, 0.00
Tasks:  23 total,   1 running,  22 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.3%us,  0.1%sy,  0.0%ni, 99.6%id,  0.1%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   2097152k total,    80772k used,  2016380k free,        0k buffers
Swap:        0k total,        0k used,        0k free,        0k cached

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
   1 root      18   0  1984  692  592 S    0  0.0   0:01.66 init
 1355 root      15   0  1696  628  508 S    0  0.0   0:00.37 syslogd
 1381 root      18   0  5276 1036  680 S    0  0.0   0:00.59 sshd
 1441 root      24   0  2704 1304 1076 S    0  0.1   0:00.00 mysqld_safe
 1514 mysql     15   0  115m  19m 5260 S    0  1.0   0:22.24 mysqld
 1515 root      18   0  1632  532  460 S    0  0.0   0:00.00 logger
 1800 root      18   0  8236  752  436 S    0  0.0   0:00.00 saslauthd
 1802 root      18   0  8236  472  156 S    0  0.0   0:00.00 saslauthd
 1813 root      18   0  2356  888  716 S    0  0.0   0:00.00 xinetd
 1948 root      15   0  8644 1972  836 S    0  0.1   0:00.53 sendmail-mta
 2008 nobody    15   0  2856 1008  576 S    0  0.0   0:00.14 proftpd
 2013 daemon    18   0  1916  432  312 S    0  0.0   0:00.00 atd
 2045 root      15   0 40964  10m 6280 S    0  0.5   0:01.81 apache2
13484 root      20   0  2040  884  704 S    0  0.0   0:00.03 cron
15420 www-data  18   0 58096  25m 3876 S    0  1.2   0:00.42 apache2
16234 www-data  15   0 58392  25m 3976 S    0  1.2   0:00.86 apache2
17736 www-data  15   0 52976  20m 3884 S    0  1.0   0:00.39 apache2
17903 www-data  18   0 41100 5796 1296 S    0  0.3   0:00.00 apache2
17904 www-data  15   0 41112 7688 2840 S    0  0.4   0:00.03 apache2
21644 root      19   0  2372  920  720 S    0  0.0   0:00.00 cron
21649 root      18   0  2436  984  844 S    0  0.0   0:00.00 sh
21652 root      15   0  2256  968  788 R    0  0.0   0:00.00 top
21654 root      18   0  1740  592  488 S    0  0.0   0:00.00 mail

Wie kann ich da die CPU Auslastung sehen? Die ist höchstens auf 0.3%us?!
Und für was sind die anderen Ausgaben, wie load avarage, user?

Weiters habe ich 2 Cronjobs erstellt, von dem nur einer ausgefüht wird. In der syslog steht kein Fehler, etc warum der andere nicht ausgeführt wird.
Die Ausgabe von crontab -l:
Code:
0 * * * * top -b -n 1 | mail -s "top" mymail@me.com
0 * * * * pstree | mail -s "pstree" mymail@me.com

PS: Die Crontabs sind nur temporär, sum kontrollieren, ob auch alles läuft bis der Server richtig eingestellt ist. Mich wunderts trotzdem, warum da keine Mail nie kommt?

Danke für eure Antowrten
^^
 
Hast Du hinter dem zweiten Crontab noch einen Zeilenumbruch? Wenn nein, machen.
Ansonsten lass mal ein "tail -f" aufs mail.log laufen, wenn der Cronjob laufen soll. Da solltest Du auch entsprechende Hinweise über den Verbleib der Mail finden.
 
Hast Du hinter dem zweiten Crontab noch einen Zeilenumbruch? Wenn nein, machen.
Ansonsten lass mal ein "tail -f" aufs mail.log laufen, wenn der Cronjob laufen soll. Da solltest Du auch entsprechende Hinweise über den Verbleib der Mail finden.

In der mail Log fand ich einen error:

Code:
connection to spamd on 127.0.0.1 failed

beim Versuch spamassasin neu zu starten, bekomme ich folgenden Fehler:
Code:
spamd: cannot use --sql-config without -u

sql wird verwendet um die von confixx-angelegten user und einstellungen abzurufen! Aber was bedeutet dieser Fehler??
 
Jetzt ist dieses Problem gelöst. Nach einem Reboot funktionierte dies. CronJobs wurden nach einfügen der neuen Zeile zum Schluss erfolgreich eingefügt.

Jedoch sind die mysql Querys immer noch über 30sek.

Meine my.cnf:
Code:
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port            = 3306
socket          = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket          = /var/run/mysqld/mysqld.sock
nice            = 0

set-variable = innodb_buffer_pool_size=2M
set-variable = innodb_additional_mem_pool_size=500K
set-variable = innodb_log_buffer_size=500K
set-variable = innodb_thread_concurrency=2
[mysqld]
set-variable=local-infile=0
#
# * Basic Settings
#
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
language        = /usr/share/mysql/english
skip-external-locking
#
# For compatibility to other Debian packages that still use
# libmysqlclient10 and libmysqlclient12.
old_passwords   = 1
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
# bind-address          = 127.0.0.1
#
# * Fine Tuning
#
open_files              = 1500
key_buffer              = 2M
max_allowed_packet      = 16M
thread_stack            = 128K
thread_cache_size       = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover         = BACKUP
max_connections        = 10
table_cache            = 512
#table_definition_cache = 512
key_buffer_size        = 800M
#read_rnd_buffer_size = 4M
#thread_concurrency     = 10
#
# * Query Cache Configuration
#
query_cache_limit       = 1M
query_cache_size        = 16M
tmp_table_size          = 256M
max_heap_table_size    = 256M


long_query_time = 2
low_priority_updates =2
read_buffer_size = 16K
myisam_sort_buffer_size = 32K
sort_buffer_size = 32K

#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
#log            = /var/log/mysql/mysql.log
#
# Error logging goes to syslog. This is a Debian improvement :)
#
# Here you can see queries with especially long duration
#log_slow_queries       = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id              = 1
#log_bin                        = /var/log/mysql/mysql-bin.log
expire_logs_days        = 10
max_binlog_size         = 100M
#binlog_do_db           = include_database_name
#binlog_ignore_db       = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



#set-variable = innodb_buffer_pool_size=2M
#set-variable = innodb_additional_mem_pool_size=500K
#set-variable = innodb_log_buffer_size=500K
#set-variable = innodb_thread_concurrency=2
#skip-innodb
[mysqldump]
quick
quote-names
max_allowed_packet      = 16M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer              = 16M

#
# * NDB Cluster
#
# See /usr/share/doc/mysql-server-*/README.Debian for more information.
#
# The following configuration is read by the NDB Data Nodes (ndbd processes)
# not from the NDB Management Nodes (ndb_mgmd processes).
#
# [MYSQL_CLUSTER]
# ndb-connectstring=127.0.0.1


#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/

Apache verursacht auch viel Speicher(CPU). Ram ist immer so ca. 300MB und auch ok.
Die apache2.conf
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 "/var/log/apache2/foo.log"
# with ServerRoot set to "" will be interpreted by the
# server as "//var/log/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.1/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"
servername localhost
#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#<IfModule !mpm_winnt.c>
#<IfModule !mpm_netware.c>
LockFile /var/lock/apache2/accept.lock
#</IfModule>
#</IfModule>

#
# 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.
# Default timeout: 300

Timeout 15

#
# 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 10

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

##
## 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          8
   MinSpareServers       5
   MaxSpareServers       20
   MaxClients          150
 #  ServerLimit         150
   MaxRequestsPerChild  1000
</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
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
   StartServers          2
   MaxClients          150
   MinSpareThreads      25
   MaxSpareThreads      75
   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
</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 /var/log/apache2/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 /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf

# Include all the user configurations:
Include /etc/apache2/httpd.conf

# Include ports listing
Include /etc/apache2/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 %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

#
# Define an access log for VirtualHosts that don't define their own logfile
CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined

#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#

#
# Putting this all together, we can internationalize error responses.
#
# We use Alias to redirect any /error/HTTP_<error>.html.var response to
# our collection of by-error message multi-language collections.  We use
# includes to substitute the appropriate text.
#
# You can modify the messages' appearance without changing any of the
# default HTTP_<error>.html.var files by adding the line:
#
#   Alias /error/include/ "/your/include/path/"
#
# which allows you to create your own set of files by starting with the
# /usr/share/apache2/error/include/ files and copying them to /your/include/path/,
# even on a per-VirtualHost basis.  The default include files will display
# your Apache version number and your ServerAdmin email address regardless
# of the setting of ServerSignature.
#
# The internationalized error documents require mod_alias, mod_include
# and mod_negotiation.  To activate them, uncomment the following 30 lines.

#    Alias /error/ "/usr/share/apache2/error/"
#
#    <Directory "/usr/share/apache2/error">
#        AllowOverride None
#        Options IncludesNoExec
#        AddOutputFilter Includes html
#        AddHandler type-map var
#        Order allow,deny
#        Allow from all
#        LanguagePriority en cs de es fr it nl sv pt-br ro
#        ForceLanguagePriority Prefer Fallback
#    </Directory>
#
#    ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
#    ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
#    ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
#    ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
#    ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
#    ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
#    ErrorDocument 410 /error/HTTP_GONE.html.var
#    ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
#    ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
#    ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
#    ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
#    ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
#    ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
#    ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
#    ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
#    ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
#    ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var



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

# Include generic snippets of statements
Include /etc/apache2/conf.d/

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/


## CONFIXX

Include /etc/apache2/confixx_mhost.conf

# It is imperative that this entry remain at the end of the file

## /CONFIXX
## special entry for correct work Parallels Confixx and phpMyAdmin
Alias /phpMyAdmin /var/www/phpmyadmin/
 <Directory "/var/www/phpmyadmin/">
 php_admin_value open_basedir ".:/var/www/phpmyadmin/:/usr/share/phpmyadmin:/et$
php_admin_value include_path ".:/var/www/phpmyadmin/"
</Directory>

Die Load ist Momentan so ca. auf 2-3.

Die user_beancounters
Code:
Version: 2.5
       uid  resource           held    maxheld    barrier      limit    failcnt
     1219:  kmemsize        8690254    8727223 2147483647 2147483647          0
            lockedpages           0          0 2147483647 2147483647          0
            privvmpages      401247     401289 2147483647 2147483647          0
            shmpages            782        782 2147483647 2147483647          0
            dummy                 0          0 2147483647 2147483647          0
            numproc              68         68 2147483647 2147483647          0
            physpages        118165     118167 2147483647 2147483647          0
            vmguarpages           0          0 2147483647 2147483647          0
            oomguarpages     118165     118167 2147483647 2147483647          0
            numtcpsock           12         15 2147483647 2147483647          0
            numflock              8          8 2147483647 2147483647          0
            numpty                1          1 2147483647 2147483647          0
            numsiginfo            0          1 2147483647 2147483647          0
            tcpsndbuf        131924     187824 2147483647 2147483647          0
            tcprcvbuf        196608     212992 2147483647 2147483647          0
            othersockbuf      60372      60372 2147483647 2147483647          0
            dgramrcvbuf           0          0 2147483647 2147483647          0
            numothersock         42         42 2147483647 2147483647          0
            dcachesize       764669     769979 2147483647 2147483647          0
            numfile            2578       2587 2147483647 2147483647          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            numiptent            14         14 2147483647 2147483647          0

Server ist folgender:
vServer Amsterdam-Profi:
http://www.mg-webservice.com/vServer-Amsterdam.php

Was würdet ihr welche Konfiguration vorschlagen, um den Server "schneller zu machen" ?
 
Das Problem lag beim Provider, anscheinend ist der Hauptserver zu sehr ausgelastet. Jetzt z.B. funktionierts wieder ohne Probleme. Heute Nachmittag war aber Katastrophal! :mad:

Ich werd denen mal eine mail schreiben :)
 
Back
Top