We have a dedicated server and we host 4 news portals based on e107 and joomla.
My partner on Sunday has upgraded mysql from version 4 to 5. Now the server experiences very high CPU usage and query time on portals has been increased very much.
We used to have query times lower than 1 sec for the main page of [url](which is a site that receives about 2000 visits/day) and now query times are 5-15sec !
Does anybody know if this is makes sense ?
Below is the server Status from WHM : -------------------------------------
cpdavd up cpsrvd up exim (exim-4.69-15.1_cpanel_maildir) up ftpd up httpd (2.2.11 (Unix)) up imap up interval up mysql (5.0.67-community-log) up named (9.3.4) up pop up rsyslogd up spamd up syslogd up Server Load 6.97 (1 cpu) Memory Used 49.4 % Swap Used 0.23 % Disk /dev/hda3 (/tmp) DMA+ 70 % Disk /dev/hda5 (/) DMA+ 22 % Disk /dev/hda1 (/boot) DMA+ 14 %
Below is the Server Information from WHM : ------------------------------------------ Processor #1 Vendor: GenuineIntel Processor #1 Name: Intel(R) Core(TM)2 Duo CPU E4600 @ 2.40GHz Processor #1 speed: 2394.068 MHz Processor #1 cache size: 2048 KB
I've got 25 domains on a Virtuozzo/Plesk8.6/CentOS5 VPS. Each domain has one up-to-date install of WordPress, most have very little traffic (average 200mb per month), maybe 2 domains get 5-7gb traffic per month.
I monitor port 80 connections and rarely see more than 10 at a time. That should in my opinion be no problem at all for a VPS with 768mb guaranteed ram and 2.4ghz cpu. I've got 30gb hard drive spare too.
But.... about 8 or 10 times a day it grinds to a complete halt: server load at 500-1000%, sites timing out, plesk takes 3mins to load, often I can't even connect with SSH, and the plesk web server, apache
80 seconds sounds like a huge amount of time for a MySQL insert to me! Does anyone know if this is likely to be the cause of my trouble? Some problem with Plesk and the database? Or could it be something else?
What is the good value to set query_cache_size. I have set it to 60 M and here is the status. Is it good? I am not sure how to check this? Can anyone explain?
query_cache_size=60M
mysql> SHOW STATUS LIKE 'Qcache%'; +-------------------------+----------+ | Variable_name | Value | +-------------------------+----------+ | Qcache_free_blocks | 5 | | Qcache_free_memory | 62666440 | | Qcache_hits | 922 | | Qcache_inserts | 381 | | Qcache_lowmem_prunes | 0 | | Qcache_not_cached | 565 | | Qcache_queries_in_cache | 182 | | Qcache_total_blocks | 400 | +-------------------------+----------+ 8 rows in set (0.00 sec)
some vBulletin customers facing to that error message, with session table with attachment only. Other just work fine. It's not because of server load. The load is just around 0 - 0.1
I have increased wait_timeout to 200 and max_allowed_packet to 64MB. Each attachment file in those vBulletin is just around 1-3MB.
I want to run flush query cache, saying once a week. Is there anyway to schedule it, so system can do it automatically? Currently, I have to login server, and run it manually
I've got a problem with an SQL query that is behaving badly. Its probably really obvious, but I can't see the problem!
I have a table with 3 fields:
Code:
money bigint(20) income int(12) userID mediumint(7)
I have a row that has a negative money and a value of 0 for income. When I update the money value to add "0" to it, nothing happens (as expected). When I update the money field to add the income field (which is equal to 0) to it, MySQL flips the sign to make the money field positive.
The following queries show the problem:
Code:
mysql> SELECT money, income from users where userID=327961; +----------------------+--------+ | money | income | +----------------------+--------+ | -9223372036854775807 | 0 | +----------------------+--------+ 1 row in set (0.00 sec)
mysql> SELECT money, income from users where userID=327961; +----------------------+--------+ | money | income | +----------------------+--------+ | -9223372036854775807 | 0 | +----------------------+--------+ 1 row in set (0.00 sec)
mysql> UPDATE `users` SET money = money + income WHERE userID =327961; Query OK, 1 row affected, 1 warning (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 1
mysql> SELECT money, income from users where userID=327961; +---------------------+--------+ | money | income | +---------------------+--------+ | 9223372036854775807 | 0 | +---------------------+--------+ 1 row in set (0.00 sec)
mysql> Notice that there is no negative sign after the third select!!
So, we are saying that executing an update where 0 is specified in the query results in the correct action but if you take the 0 from another field it takes the negative sign away...
This for various reasons is a rather urgent problem. This problem has only appeared after upgrading from MySQL 4.0 to MySQl 5.1. This problem does not occur in MySQL 4.1.
I'm running a forum system on my server. Loading pages that don't connect to the forum database load normal. Whenever I browse any page that connects to the forum database on my forum, the page either takes ages to load or times out loading. I never exceed using 14% of one of my two cores, I'm using a quarter of my 1.5GB ram. It's only been loading slow like this since I've switched from running Windows to Ubuntu Server 8.10. I enabled logging slow queries on SQL, but nothing's been recorded. I've installed the server packages through Webmin,
when I access the server through its local IP address it's still very slow.
At the PHP level, we have the following in our php.ini (some of these were recommended in our documentation to start with):
max_execution_time = 300 memory_limit = 128M error_reporting = 2039 display_errors = Off register_globals = Off
/etc/my.cnf
[mysqld] local-infile=0 datadir=/var/lib/mysql skip-locking skip-innodb skip-networking safe-show-database query_cache_limit=1M query_cache_size=32M ## 32MB for every 1GB of RAM query_cache_type=1 max_user_connections=500 max_connections=1500 interactive_timeout=10 wait_timeout=28800 connect_timeout=20 thread_cache_size=128 key_buffer=512M ## 128MB for every 1GB of RAM join_buffer=4M max_connect_errors=20 max_allowed_packet=16M table_cache=1024 record_buffer=4M sort_buffer_size=4M ## 1MB for every 1GB of RAM read_buffer_size=4M ## 1MB for every 1GB of RAM read_rnd_buffer_size=4M ## 1MB for every 1GB of RAM thread_concurrency=8 ## Number of CPUs x 2 myisam_sort_buffer_size=64M server-id=1 collation-server=latin1_general_ci
What I did here was create /var/log/mysqld.slow.log for queries that are taking one second or longer. After around 36 hours, here is what I came up with. Since the file size of /var/log/mysqld.slow.log was 219KB, posting it in its entirety it not practical. Therefore, I used a program, the perl script known as mysql_slow_log_parser found on www.retards.org, to parse the mysqld.slow.log to make it easier to interpret and read. The result was that the original filesize of 219KB was converted to the smaller size of 14KB....
I'm hosting about 6 private websites on my server, and some have problems.
My biggest website is a vb forum with 30.000 members and 1.5 million posts.
When i browse with firefox i see that vb forum loads fast, but phpads which is integrated on the top and footer loads very slow. When i browse with IE, it takes like 10 seconds before the whole site is loaded and sometimes IE even crashes.
When i try to login on another website / admin panel (oscommerce), i get a mysql gone away error, that means timeout. But why does it show that? I ran mysqlreport and can't find anything why it should display mysql gone away. # ./mysqlreport MySQL 5.0.15-standard uptime 3 19:36:47 Mon Feb 5 11:08:10 2007
__ Key _________________________________________________________________ Buffer usage 78.94M of 96.00M %Used: 82.23 Write ratio 0.60 Read ratio 0.00
I have windows server 2012 and Plesk v12.0.18 #30 - I noticed speed problem.
When I try to connect to mySQL with:
$conn = new mysqli('localhost', 'joomla_***', '*****', 'joomla_test');
Connection takes 1 second!!!When I try to connect with '127.0.0.1' instead of 'localhost' connection takes 0,009 seconds.
1. I tried solution to add line '127.0.0.1 localhost' to c:windowssystem32driversetshosts - but no luck.
2. I tried to edit C:Program Files (x86)ParallelsPleskMySQLDatamy.ini - adding lines bind-address=127.0.0.1 skip-name-resolve then restarted mySql but 1 second lag time on connection was still there.
3. I even tried to disable IPv6 but still no luck
I guess all users windows windows server 2012 has the same problem??!?!...
Firstly this question is not related to running a web hosting business, but to dedicated servers hosting our own websites.
I was just wondering, other than security reasons, what is the importance (if any) of keeping Apache/WWW logs? Are there legal reasons?
If it is best to keep Apache logs, how should we go about this? If we don't look after them properly there will be massive amounts of logs being kept - what is the best way to store them? I know they can be "rolled over" and kept for a certain amount of time, which is the best utility to do this?
The OS is Linux (CentOS) and the web servers are Apache and Lighttpd.
and should proxy/gateway/cache server logs be kept?
I just bought a new dedicated server and have got Lxadmin on it. Now lxadmin , automatically uses a different loggin system than I would want it to use. It creates a seperate log file for each doamin.
They are located in /home/httpd/EXAMPLE.com/stats
EXAMPLE.com-error_log EXAMPLE.com-custom_log
Now the problem is that I have literally hundreds of domains and I want it to instead log at a single place and not at these hundreds of seperate places.
This is the root cause of my problem
# The location and format of the access logfile (Common Logfile Format). # If you do not define any access logfiles within a <VirtualHost> # container, they will be logged here. Contrariwise, if you *do* # define per-<VirtualHost> access logfiles, transactions will be # logged therein and *not* in this file.
I am unable to have any kind of centralised logging command because of the individual entries for each Virtual host.
Even if i can manually remove those entries once, and new domain created by lxadmin will have that same problem. Morevoer, any kind of update of lxadmin which rebuilds the database will also ruin all the hardwork that I put in.
Is there any suggestion / solution to this problem? Have centralised data at one place in a single file?