Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am running a small vserver with debian 8.4. I use it to host some small websites and an email ticket system. Therefore apache2, mysql and postfix is running.
Since the last two weeks I noticed that the server becomes unreachable from time to time. Then I can not access via http nor via ssh. Sometimes the server is back after some minutes, sometimes I have to reboot via control utilies from my provider.
After some investigation I thought that a corrupt mysql database caused this issue, since I found a lot of corrupt table errors. I have repaired the database, but the problems are not gone.
In /var/log/syslog I found some memory related errors and I ask my provider if there are any hardware issue on the vserver. The answer: No.
So what can I do to find out what program/script is causing this?
For example at 14:45 I noticed that the server is not reachable. At 14:50 the server is back without any action from me. In syslog I see only these logs for this time range:
Code:
Nov 16 14:44:26 mail postfix/smtpd[6806]: warning: hostname fengshangtai.com does not resolve to address 104.168.74.155
Nov 16 14:44:26 mail postfix/smtpd[6806]: connect from unknown[104.168.74.155]
Nov 16 14:44:28 mail postfix/trivial-rewrite[6809]: warning: connect to mysql server 127.0.0.1: Can't create a new thread (errno 11); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug
Nov 16 14:44:28 mail postfix/trivial-rewrite[6809]: warning: mysql:/etc/postfix/mysql-virtual_mailbox_domains.cf: table lookup problem
Nov 16 14:44:28 mail postfix/trivial-rewrite[6809]: warning: virtual_mailbox_domains lookup failure
Nov 16 14:44:28 mail postfix/trivial-rewrite[6809]: warning: mysql:/etc/postfix/mysql-virtual_mailbox_domains.cf: table lookup problem
Nov 16 14:44:28 mail postfix/trivial-rewrite[6809]: warning: virtual_mailbox_domains lookup failure
Nov 16 14:44:40 mail postfix/trivial-rewrite[6809]: warning: mysql:/etc/postfix/mysql-virtual_mailbox_domains.cf: table lookup problem
Nov 16 14:45:01 mail CRON[6818]: (CRON) error (can't fork)
Nov 16 14:45:01 mail CRON[6819]: (CRON) error (can't fork)
Nov 16 14:47:49 mail postfix/anvil[6808]: statistics: max connection rate 1/60s for (smtp:104.168.74.155) at Nov 16 14:44:26
Nov 16 14:47:49 mail postfix/anvil[6808]: statistics: max connection count 1 for (smtp:104.168.74.155) at Nov 16 14:44:26
Nov 16 14:47:49 mail postfix/anvil[6808]: statistics: max cache size 1 at Nov 16 14:44:26
Nov 16 14:48:01 mail CRON[6863]: (CRON) error (can't fork)
Nov 16 14:48:01 mail CRON[6861]: (CRON) error (can't fork)
Nov 16 14:48:16 mail postfix/master[1421]: warning: master_wakeup_timer_event: service flush(public/flush): Cannot allocate memory
Have you tried using vmstat to see if your server is swapping?
Maybe you could run it every couple of minutes to see if its swapping? (Wrap it in a script to check the swapping fields only and write to a lot file if they are?)
Code:
$ vmstat 1
procs ---------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
34 0 0 200889792 73708 591828 0 0 0 5 6 10 96 1 3 0 0
32 0 0 200889920 73708 591860 0 0 0 592 13284 4282 98 1 1 0 0
32 0 0 200890112 73708 591860 0 0 0 0 9501 2154 99 1 0 0 0
32 0 0 200889568 73712 591856 0 0 0 48 11900 2459 99 0 0 0 0
32 0 0 200890208 73712 591860 0 0 0 0 15898 4840 98 1 1 0 0
^C
*si, so: Swap-ins and swap-outs. If these are non-zero, you’re out of memory.
This webpage is a good resource for a 60 second check of performance analysis.
It doesn't look like you're running out of memory (~ 3 GB free out of 4 GB total). However, as you note kmemsize does seem to be an issue. According to some reading that I did, kmemsize is the amount of un-swappable memory reserved for the kernel by the VM host. So, this is something that is under the control of your provide. I found this thread on webhostingtalk that has some details. If your host handles a lot of traffic, it's probably that your kernel needs to use a lot of memory, e.g. for socket buffers. Depending on your requirements, you may be able to tune your kernel to use less memory. If you can't, and you can't get your hosting provider to allocate more resources, you might have no choice but to switch to a better provisioned instance.
This is interesting. It means that if you run out of RAM, even briefly, the system is 'stuck' as you have NO swap configured for it to overflow into.
You can check that from 'top' as well.
Its not that unusual for a server to use some swap now and again.
This is all a configuration set up by a provider - they have an (pecuniary) interest in limiting everything each guest gets.
As btmiller says, start negotiating - even the prospect (threat) of leaving might be enough to get a reaction. Send them the UBC output.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.