MySQL szerver folyamatosan leáll (Debian 8 VPS)

Fórumok

Sziasztok!

Van egy VPS, amiről egy oldal fut. Az adatbázis szerver folyamatosan leáll. Van hogy 1-2 napig megy, de sok esetben pár óránként. Nincs kiugróan nagy terhelés rajta.

1GB ram vana vps-ben, de max 450 megáig megy a terhelés. A processzor használat is minimális.

mysqltuner-el próbáltam debugolni, ami a tmp_table_size és a max_heap_table_size értékeket akarja emelni folyamatosan. Véleményem szerint elég magas értéken van már jelenleg is.

Amikor leáll a syslogban a következő van:

Mar 20 10:03:11 vps kernel: [561306.708409] php-cgi invoked oom-killer: gfp_mask=0x200da, order=0, oom_score_adj=0
Mar 20 10:03:11 vps kernel: [561306.708413] php-cgi cpuset=/ mems_allowed=0
Mar 20 10:03:11 vps kernel: [561306.708418] CPU: 0 PID: 7861 Comm: php-cgi Not tainted 3.16.0-4-amd64 #1 Debian 3.16.7-ckt20-1+deb8u4
Mar 20 10:03:11 vps kernel: [561306.708419] 0000000000000000 ffffffff8150dcff ffff880003f6f670 ffffffff8150b917
Mar 20 10:03:11 vps kernel: [561306.708421] 0000000000000000 ffffffff810d4f8f 0000000000000000 ffffffff8151267e
Mar 20 10:03:11 vps kernel: [561306.708422] 0000000000000200 ffffffff81067993 ffffffff810c26a4 0000000000000000
Mar 20 10:03:11 vps kernel: [561306.708424] Call Trace:
Mar 20 10:03:11 vps kernel: [561306.708433] [] ? dump_stack+0x41/0x51
Mar 20 10:03:11 vps kernel: [561306.708434] [] ? dump_header+0x76/0x1e8
Mar 20 10:03:11 vps kernel: [561306.708439] [] ? smp_call_function_single+0x5f/0xa0
Mar 20 10:03:11 vps kernel: [561306.708443] [] ? mutex_lock+0xe/0x2a
Mar 20 10:03:11 vps kernel: [561306.708446] [] ? put_online_cpus+0x23/0x80
Mar 20 10:03:11 vps kernel: [561306.708449] [] ? rcu_oom_notify+0xc4/0xe0
Mar 20 10:03:11 vps kernel: [561306.708454] [] ? do_try_to_free_pages+0x4ac/0x520
Mar 20 10:03:11 vps kernel: [561306.708457] [] ? oom_kill_process+0x21d/0x370
Mar 20 10:03:11 vps kernel: [561306.708458] [] ? find_lock_task_mm+0x3d/0x90
Mar 20 10:03:11 vps kernel: [561306.708460] [] ? out_of_memory+0x473/0x4b0
Mar 20 10:03:11 vps kernel: [561306.708462] [] ? __alloc_pages_nodemask+0x9cd/0xb30
Mar 20 10:03:11 vps kernel: [561306.708465] [] ? alloc_pages_vma+0x98/0x160
Mar 20 10:03:11 vps kernel: [561306.708466] [] ? shmem_alloc_page+0x63/0x90
Mar 20 10:03:11 vps kernel: [561306.708468] [] ? release_pages+0x85/0x220
Mar 20 10:03:11 vps kernel: [561306.708471] [] ? radix_tree_insert+0x2b/0xe0
Mar 20 10:03:11 vps kernel: [561306.708473] [] ? radix_tree_lookup_slot+0xe/0x30
Mar 20 10:03:11 vps kernel: [561306.708474] [] ? find_lock_entry+0x1a/0x60
Mar 20 10:03:11 vps kernel: [561306.708476] [] ? shmem_getpage_gfp+0x3f2/0x800
Mar 20 10:03:11 vps kernel: [561306.708477] [] ? shmem_fault+0x5f/0x1c0
Mar 20 10:03:11 vps kernel: [561306.708481] [] ? pte_pfn_to_mfn.part.11+0x78/0x90
Mar 20 10:03:11 vps kernel: [561306.708482] [] ? xen_set_pte_at+0x8a/0x240
Mar 20 10:03:11 vps kernel: [561306.708484] [] ? __do_fault+0x3a/0xa0
Mar 20 10:03:11 vps kernel: [561306.708486] [] ? do_shared_fault.isra.55+0x2f/0x1d0
Mar 20 10:03:11 vps kernel: [561306.708488] [] ? handle_mm_fault+0x5f5/0x11c0
Mar 20 10:03:11 vps kernel: [561306.708490] [] ? xen_force_evtchn_callback+0x9/0x10
Mar 20 10:03:11 vps kernel: [561306.708491] [] ? check_events+0x12/0x20
Mar 20 10:03:11 vps kernel: [561306.708494] [] ? __do_page_fault+0x177/0x4f0
Mar 20 10:03:11 vps kernel: [561306.708496] [] ? xen_mc_flush+0x172/0x1a0
Mar 20 10:03:11 vps kernel: [561306.708498] [] ? xen_write_msr_safe+0x7b/0xc0
Mar 20 10:03:11 vps kernel: [561306.708500] [] ? __switch_to+0x15c/0x570
Mar 20 10:03:11 vps kernel: [561306.708504] [] ? finish_task_switch+0x46/0xf0
Mar 20 10:03:11 vps kernel: [561306.708506] [] ? page_fault+0x28/0x30
Mar 20 10:03:11 vps kernel: [561306.708507] Mem-Info:
Mar 20 10:03:11 vps kernel: [561306.708509] Node 0 DMA per-cpu:
Mar 20 10:03:11 vps kernel: [561306.708510] CPU 0: hi: 0, btch: 1 usd: 0
Mar 20 10:03:11 vps kernel: [561306.708511] Node 0 DMA32 per-cpu:
Mar 20 10:03:11 vps kernel: [561306.708512] CPU 0: hi: 186, btch: 31 usd: 30
Mar 20 10:03:11 vps kernel: [561306.708515] active_anon:157260 inactive_anon:64151 isolated_anon:0
Mar 20 10:03:11 vps kernel: [561306.708515] active_file:22 inactive_file:47 isolated_file:0
Mar 20 10:03:11 vps kernel: [561306.708515] unevictable:0 dirty:2 writeback:5 unstable:0
Mar 20 10:03:11 vps kernel: [561306.708515] free:1960 slab_reclaimable:3572 slab_unreclaimable:7695
Mar 20 10:03:11 vps kernel: [561306.708515] mapped:60181 shmem:64866 pagetables:16323 bounce:0
Mar 20 10:03:11 vps kernel: [561306.708515] free_cma:0
Mar 20 10:03:11 vps kernel: [561306.708517] Node 0 DMA free:3968kB min:60kB low:72kB high:88kB active_anon:7028kB inactive_anon:2904kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:15996kB managed:15912kB mlocked:0kB dirty:0kB writeback:0kB mapped:2752kB shmem:2940kB slab_reclaimable:168kB slab_unreclaimable:464kB kernel_stack:512kB pagetables:564kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes
Mar 20 10:03:11 vps kernel: [561306.708520] lowmem_reserve[]: 0 978 978 978
Mar 20 10:03:11 vps kernel: [561306.708522] Node 0 DMA32 free:3872kB min:3968kB low:4960kB high:5952kB active_anon:622012kB inactive_anon:253700kB active_file:88kB inactive_file:188kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:1032192kB managed:1004408kB mlocked:0kB dirty:8kB writeback:20kB mapped:237972kB shmem:256524kB slab_reclaimable:14120kB slab_unreclaimable:30316kB kernel_stack:3552kB pagetables:64728kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:418 all_unreclaimable? yes
Mar 20 10:03:11 vps kernel: [561306.708525] lowmem_reserve[]: 0 0 0 0
Mar 20 10:03:11 vps kernel: [561306.708527] Node 0 DMA: 462*4kB (EM) 75*8kB (M) 1*16kB (R) 3*32kB (R) 0*64kB 1*128kB (R) 1*256kB (R) 0*512kB 1*1024kB (R) 0*2048kB 0*4096kB = 3968kB
Mar 20 10:03:11 vps kernel: [561306.708532] Node 0 DMA32: 202*4kB (UEM) 111*8kB (UEMR) 6*16kB (UM) 5*32kB (M) 2*64kB (U) 0*128kB 1*256kB (R) 1*512kB (R) 1*1024kB (R) 0*2048kB 0*4096kB = 3872kB
Mar 20 10:03:11 vps kernel: [561306.708539] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
Mar 20 10:03:11 vps kernel: [561306.708540] 64956 total pagecache pages
Mar 20 10:03:11 vps kernel: [561306.708541] 0 pages in swap cache
Mar 20 10:03:11 vps kernel: [561306.708542] Swap cache stats: add 0, delete 0, find 0/0
Mar 20 10:03:11 vps kernel: [561306.708542] Free swap = 0kB
Mar 20 10:03:11 vps kernel: [561306.708543] Total swap = 0kB
Mar 20 10:03:11 vps kernel: [561306.708544] 262047 pages RAM
Mar 20 10:03:11 vps kernel: [561306.708544] 0 pages HighMem/MovableOnly
Mar 20 10:03:11 vps kernel: [561306.708545] 6946 pages reserved
Mar 20 10:03:11 vps kernel: [561306.708545] 0 pages hwpoisoned
Mar 20 10:03:11 vps kernel: [561306.708546] [ pid ] uid tgid total_vm rss nr_ptes swapents oom_score_adj name
Mar 20 10:03:11 vps kernel: [561306.708548] [ 126] 0 126 7218 532 18 0 0 systemd-journal
Mar 20 10:03:11 vps kernel: [561306.708550] [ 129] 0 129 10234 156 21 0 -1000 systemd-udevd
Mar 20 10:03:11 vps kernel: [561306.708551] [ 333] 0 333 9270 108 23 0 0 rpcbind
Mar 20 10:03:11 vps kernel: [561306.708553] [ 359] 106 359 9320 148 24 0 0 rpc.statd
Mar 20 10:03:11 vps kernel: [561306.708554] [ 426] 0 426 6892 55 18 0 0 rpc.idmapd
Mar 20 10:03:11 vps kernel: [561306.708555] [ 428] 0 428 2650 33 10 0 0 inetd
Mar 20 10:03:11 vps kernel: [561306.708557] [ 429] 116 429 81863 125 24 0 0 memcached
Mar 20 10:03:11 vps kernel: [561306.708558] [ 432] 117 432 41910 3212 47 0 0 named
Mar 20 10:03:11 vps kernel: [561306.708559] [ 435] 0 435 13796 168 31 0 -1000 sshd
Mar 20 10:03:11 vps kernel: [561306.708560] [ 436] 113 436 23745 783 50 0 0 freshclam
Mar 20 10:03:11 vps kernel: [561306.708562] [ 438] 0 438 4756 45 14 0 0 atd
Mar 20 10:03:11 vps kernel: [561306.708563] [ 440] 0 440 4964 62 14 0 0 systemd-logind
Mar 20 10:03:11 vps kernel: [561306.708564] [ 457] 0 457 5484 79 16 0 0 dovecot
Mar 20 10:03:11 vps kernel: [561306.708565] [ 459] 105 459 10531 97 25 0 -900 dbus-daemon
Mar 20 10:03:11 vps kernel: [561306.708567] [ 526] 0 526 64667 435 28 0 0 rsyslogd
Mar 20 10:03:11 vps kernel: [561306.708568] [ 528] 0 528 1064 39 8 0 0 acpid
Mar 20 10:03:11 vps kernel: [561306.708569] [ 529] 111 529 2311 40 9 0 0 anvil
Mar 20 10:03:11 vps kernel: [561306.708570] [ 530] 0 530 2343 77 9 0 0 log
Mar 20 10:03:11 vps kernel: [561306.708572] [ 538] 0 538 3604 41 11 0 0 agetty
Mar 20 10:03:11 vps kernel: [561306.708573] [ 539] 0 539 3559 38 12 0 0 agetty
Mar 20 10:03:11 vps kernel: [561306.708574] [ 611] 0 611 5044 99 14 0 0 xe-daemon
Mar 20 10:03:11 vps kernel: [561306.708575] [ 825] 38 825 15424 2297 31 0 0 mailmanctl
Mar 20 10:03:11 vps kernel: [561306.708577] [ 827] 38 827 15418 2291 32 0 0 python
Mar 20 10:03:11 vps kernel: [561306.708578] [ 831] 38 831 15399 2295 33 0 0 python
Mar 20 10:03:11 vps kernel: [561306.708579] [ 838] 38 838 15408 2287 33 0 0 python
Mar 20 10:03:11 vps kernel: [561306.708580] [ 839] 38 839 15419 2287 34 0 0 python
Mar 20 10:03:11 vps kernel: [561306.708581] [ 843] 38 843 15395 2308 33 0 0 python
Mar 20 10:03:11 vps kernel: [561306.708582] [ 845] 38 845 15394 2322 33 0 0 python
Mar 20 10:03:11 vps kernel: [561306.708584] [ 848] 38 848 15418 2287 35 0 0 python
Mar 20 10:03:11 vps kernel: [561306.708585] [ 861] 38 861 15418 2286 34 0 0 python
Mar 20 10:03:11 vps kernel: [561306.708586] [ 1030] 0 1030 160665 1916 42 0 0 fail2ban-server
Mar 20 10:03:11 vps kernel: [561306.708587] [ 1375] 0 1375 9041 150 21 0 0 master
Mar 20 10:03:11 vps kernel: [561306.708588] [ 1377] 110 1377 14602 222 30 0 0 qmgr
Mar 20 10:03:11 vps kernel: [561306.708589] [ 1380] 110 1380 10614 158 25 0 0 tlsmgr
Mar 20 10:03:11 vps kernel: [561306.708591] [ 1675] 108 1675 8344 154 22 0 0 ntpd
Mar 20 10:03:11 vps kernel: [561306.708592] [ 9237] 0 9237 6876 71 18 0 0 cron
Mar 20 10:03:11 vps kernel: [561306.708593] [ 9835] 0 9835 138861 7122 192 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708595] [10581] 0 10581 10895 209 23 0 0 pure-ftpd-mysql
Mar 20 10:03:11 vps kernel: [561306.708596] [ 2028] 0 2028 5457 113 15 0 0 mysqld_safe
Mar 20 10:03:11 vps kernel: [561306.708597] [ 2524] 109 2524 215554 25526 108 0 0 mysqld
Mar 20 10:03:11 vps kernel: [561306.708599] [16242] 0 16242 3332 73 12 0 0 ssl-params
Mar 20 10:03:11 vps kernel: [561306.708600] [25790] 0 25790 5524 652 14 0 0 vlogger (access
Mar 20 10:03:11 vps kernel: [561306.708601] [25791] 0 25791 48663 4370 85 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708603] [25792] 0 25792 55811 71 20 0 -1000 PassengerWatchd
Mar 20 10:03:11 vps kernel: [561306.708604] [25795] 0 25795 126700 72 25 0 0 PassengerHelper
Mar 20 10:03:11 vps kernel: [561306.708605] [25800] 65534 25800 56668 299 51 0 0 PassengerLoggin
Mar 20 10:03:11 vps kernel: [561306.708606] [ 3439] 110 3439 9557 138 21 0 0 pickup
Mar 20 10:03:11 vps kernel: [561306.708607] [ 3988] 5004 3988 131467 7797 154 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708609] [ 5564] 5003 5564 130029 3271 140 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708610] [ 5566] 5003 5566 130557 3049 133 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708611] [ 5934] 5004 5934 131460 7667 154 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708612] [ 6857] 5004 6857 131268 7942 152 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708613] [ 7303] 33 7303 139004 5582 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708615] [ 7315] 33 7315 139004 5583 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708616] [ 7323] 33 7323 139004 5572 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708617] [ 7360] 5004 7360 131722 8181 156 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708618] [ 7376] 5004 7376 131331 7453 153 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708620] [ 7377] 5004 7377 131399 7242 148 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708621] [ 7396] 33 7396 139005 5536 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708622] [ 7397] 33 7397 138942 5501 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708623] [ 7480] 5004 7480 131595 7375 153 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708624] [ 7481] 5004 7481 131399 7226 147 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708625] [ 7500] 5004 7500 131528 7361 147 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708627] [ 7542] 33 7542 139004 5598 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708628] [ 7546] 33 7546 139004 5599 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708629] [ 7570] 33 7570 139002 5569 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708630] [ 7619] 0 7619 10560 99 26 0 0 cron
Mar 20 10:03:11 vps kernel: [561306.708631] [ 7621] 0 7621 3305 43 11 0 0 sh
Mar 20 10:03:11 vps kernel: [561306.708633] [ 7623] 0 7623 3311 59 11 0 0 server.sh
Mar 20 10:03:11 vps kernel: [561306.708634] [ 7624] 0 7624 3305 53 11 0 0 sh
Mar 20 10:03:11 vps kernel: [561306.708635] [ 7628] 0 7628 99390 2644 144 0 0 php
Mar 20 10:03:11 vps kernel: [561306.708636] [ 7668] 33 7668 138979 5560 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708638] [ 7674] 33 7674 139005 5560 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708639] [ 7739] 33 7739 138968 5551 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708640] [ 7740] 5004 7740 131270 7041 154 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708641] [ 7741] 33 7741 139004 5546 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708642] [ 7743] 33 7743 138954 5522 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708643] [ 7746] 33 7746 139005 5580 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708645] [ 7748] 5004 7748 131399 7164 152 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708646] [ 7764] 33 7764 139006 5595 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708647] [ 7765] 33 7765 139004 5579 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708648] [ 7767] 5004 7767 131140 6907 149 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708649] [ 7798] 5004 7798 131528 7293 151 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708651] [ 7808] 33 7808 138888 5436 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708652] [ 7809] 33 7809 139002 5527 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708653] [ 7810] 33 7810 138942 5495 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708654] [ 7812] 33 7812 138886 5436 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708656] [ 7820] 33 7820 138996 5527 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708657] [ 7821] 33 7821 139002 5527 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708658] [ 7822] 33 7822 138974 5543 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708659] [ 7823] 0 7823 10560 99 26 0 0 cron
Mar 20 10:03:11 vps kernel: [561306.708660] [ 7826] 33 7826 138888 5416 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708661] [ 7827] 33 7827 138888 5416 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708663] [ 7828] 110 7828 9590 143 23 0 0 showq
Mar 20 10:03:11 vps kernel: [561306.708664] [ 7829] 0 7829 3305 43 11 0 0 sh
Mar 20 10:03:11 vps kernel: [561306.708665] [ 7830] 0 7830 3311 58 11 0 0 server.sh
Mar 20 10:03:11 vps kernel: [561306.708666] [ 7831] 0 7831 3305 52 10 0 0 sh
Mar 20 10:03:11 vps kernel: [561306.708667] [ 7834] 0 7834 98686 1902 139 0 0 php
Mar 20 10:03:11 vps kernel: [561306.708669] [ 7835] 33 7835 138888 5416 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708670] [ 7836] 33 7836 138888 5415 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708671] [ 7837] 33 7837 138886 5413 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708672] [ 7838] 33 7838 138886 5413 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708673] [ 7839] 33 7839 138888 5416 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708675] [ 7840] 33 7840 138886 5419 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708676] [ 7841] 33 7841 138888 5416 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708677] [ 7842] 33 7842 138886 5413 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708678] [ 7843] 33 7843 138886 5413 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708679] [ 7844] 33 7844 138888 5414 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708681] [ 7845] 33 7845 138888 5416 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708682] [ 7846] 33 7846 138888 5415 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708683] [ 7847] 33 7847 138888 5416 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708684] [ 7848] 33 7848 138888 5416 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708685] [ 7849] 33 7849 138888 5414 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708687] [ 7850] 33 7850 138888 5414 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708688] [ 7851] 33 7851 138886 5413 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708689] [ 7852] 33 7852 138888 5414 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708690] [ 7853] 33 7853 138886 5413 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708691] [ 7854] 33 7854 138888 5416 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708692] [ 7855] 33 7855 138886 5413 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708694] [ 7856] 33 7856 138883 5427 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708695] [ 7857] 33 7857 138888 5414 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708696] [ 7858] 33 7858 138883 5413 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708697] [ 7859] 33 7859 138883 5416 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708698] [ 7860] 5004 7860 103406 1870 134 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708700] [ 7861] 5004 7861 113646 2789 140 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708701] [ 7862] 5004 7862 113646 2652 142 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708702] [ 7863] 5004 7863 113646 2129 146 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708703] [ 7864] 5004 7864 113646 2128 140 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708704] [ 7865] 5004 7865 113646 2057 139 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708705] [ 7866] 5004 7866 97262 1870 136 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708707] [ 7867] 5004 7867 97262 1868 138 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708708] [ 7868] 5004 7868 97262 1870 137 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708709] [ 7869] 5004 7869 113646 2259 140 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708710] [ 7870] 5004 7870 97262 1870 141 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708711] [ 7874] 5004 7874 97262 1869 137 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708712] [ 7876] 5004 7876 97262 1870 138 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708714] [ 7877] 5004 7877 113646 2063 137 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708715] [ 7878] 5004 7878 113646 2059 136 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708716] [ 7879] 5004 7879 97262 1870 137 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708717] [ 7882] 5004 7882 113646 2322 141 0 0 php-cgi
Mar 20 10:03:11 vps kernel: [561306.708718] [ 7927] 33 7927 138886 5412 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708720] [ 7928] 0 7928 1059 20 8 0 0 sleep
Mar 20 10:03:11 vps kernel: [561306.708721] [ 7929] 33 7929 138869 5404 170 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708722] [ 7930] 33 7930 138869 5404 170 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708723] [ 7931] 33 7931 138869 5404 170 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708724] [ 7932] 33 7932 138869 5404 170 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708726] [ 7933] 33 7933 138883 5424 172 0 0 apache2
Mar 20 10:03:11 vps kernel: [561306.708727] [ 7934] 0 7934 6876 70 17 0 0 cron
Mar 20 10:03:11 vps kernel: [561306.708728] [ 7935] 5004 7935 3699 43 12 0 0 suexec
Mar 20 10:03:11 vps kernel: [561306.708729] [ 7936] 5004 7936 3699 42 12 0 0 suexec
Mar 20 10:03:11 vps kernel: [561306.708730] [ 7937] 5004 7937 3699 43 12 0 0 suexec
Mar 20 10:03:11 vps kernel: [561306.708731] [ 7938] 5004 7938 3699 43 12 0 0 suexec
Mar 20 10:03:11 vps kernel: [561306.708733] [ 7939] 5004 7939 3699 43 11 0 0 suexec
Mar 20 10:03:11 vps kernel: [561306.708734] [ 7940] 5004 7940 3699 43 12 0 0 suexec
Mar 20 10:03:11 vps kernel: [561306.708735] [ 7941] 5004 7941 3699 43 12 0 0 suexec
Mar 20 10:03:11 vps kernel: [561306.708736] [ 7942] 5004 7942 3699 43 12 0 0 suexec
Mar 20 10:03:11 vps kernel: [561306.708737] [ 7943] 5004 7943 3699 43 12 0 0 suexec
Mar 20 10:03:11 vps kernel: [561306.708738] [ 7944] 5004 7944 3699 44 11 0 0 suexec
Mar 20 10:03:11 vps kernel: [561306.708739] [ 7945] 5004 7945 3699 43 13 0 0 suexec
Mar 20 10:03:11 vps kernel: [561306.708740] [ 7946] 5004 7946 3699 44 12 0 0 suexec
Mar 20 10:03:11 vps kernel: [561306.708741] [ 7947] 5004 7947 3699 44 11 0 0 suexec
Mar 20 10:03:11 vps kernel: [561306.708743] [ 7948] 5004 7948 3699 43 12 0 0 suexec
Mar 20 10:03:11 vps kernel: [561306.708744] [ 7949] 5004 7949 3699 43 12 0 0 suexec
Mar 20 10:03:11 vps kernel: [561306.708745] Out of memory: Kill process 2524 (mysqld) score 100 or sacrifice child
Mar 20 10:03:11 vps kernel: [561306.708756] Killed process 2524 (mysqld) total-vm:862216kB, anon-rss:102104kB, file-rss:0kB

my.conf:

#
# 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
lc-messages-dir = /usr/share/mysql
skip-external-locking

#######
tmp_table_size = 128M
max_heap_table_size = 128M
join_buffer_size = 1M
#######
#
# 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 = 16M
max_allowed_packet = 16M
thread_stack = 192K
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 = 640
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 10M
query_cache_size = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
slow_query_log_file = /var/log/mysql/mysql-slow.log
slow_query_log = 1
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_buffer_pool_size = 100M
# 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

[mysqldump]
quick
quote-names
max_allowed_packet = 16M

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

[isamchk]
key_buffer = 16M

#
# * 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/

mysqltuner:

>> MySQLTuner 1.3.0 - Major Hayden
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
[OK] Logged in using credentials from debian maintenance account.
[OK] Currently running supported MySQL version 5.5.47-0+deb8u1-log
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM
[--] Data in MyISAM tables: 36M (Tables: 86)
[--] Data in InnoDB tables: 66M (Tables: 62)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[!!] Total fragmented tables: 67

-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned

-------- Performance Metrics -------------------------------------------------
[--] Up for: 1h 30m 41s (157K q [28.896 qps], 2K conn, TX: 612M, RX: 42M)
[--] Reads / Writes: 86% / 14%
[--] Total buffers: 276.0M global + 3.6M per thread (151 max threads)
[OK] Maximum possible memory usage: 813.9M (81% of installed RAM)
[OK] Slow queries: 1% (2K/157K)
[OK] Highest usage of available connections: 5% (9/151)
[OK] Key buffer size / total MyISAM indexes: 16.0M/8.2M
[OK] Key buffer hit rate: 99.9% (9K cached / 7 reads)
[OK] Query cache efficiency: 94.4% (142K cached / 150K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 1K sorts)
[!!] Temporary tables created on disk: 36% (572 on disk / 1K total)
[OK] Thread cache hit rate: 99% (9 created / 2K connections)
[OK] Table cache hit rate: 96% (192 open / 199 opened)
[OK] Open file limit used: 21% (221/1K)
[OK] Table locks acquired immediately: 100% (9K immediate / 9K locks)
[OK] InnoDB buffer pool / data size: 100.0M/66.6M
[OK] InnoDB log waits: 0
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
MySQL started within last 24 hours - recommendations may be inaccurate
When making adjustments, make tmp_table_size/max_heap_table_size equal
Reduce your SELECT DISTINCT queries without LIMIT clauses
Variables to adjust:
tmp_table_size (> 128M)
max_heap_table_size (> 128M)

Van valakinek ötlete, mi okozhatja a hibát és hol keressem?

Hozzászólások

Mar 20 10:03:11 vps kernel: [561306.708745] Out of memory: Kill process 2524 (mysqld) score 100 or sacrifice child

Elfogyott a RAM.

Ez valami konténer alapú (openvz/lxc) VPS ?

Fedora 23, Thinkpad x220

Nem biztos, hogy leak van, egyszerűen a mysql-nek van egy bázisa (alap configgal 3-400mb is lehet InnodB esetén), amihez hozzájöhet annyi, hogy eléri az 1gb-ot. Ugye az apache másik gépen van? Mert az is fogyasztana...

Swap jó ötlet lehet, akár 4-8gb is tesztelési célból, hogy lássuk, meddig szalad fel.

Legyünk őszinték: erre a problémára az a megoldás, hogy a gépre max. annyi kérést engedek be párhuzamosan, amennyihez a RAM elég. 1GB-nál nyilván pár db kérés lehet maximum, ha nem lehet nagyon alacsonyan meghúzni a memóriakorlátot. A DoS védelem szép dolog, de önmagában nem elég, mert legitim forgalommal is gyorsan le lehet ültetni egy 1GB-os gépet, ha nem totál lightweight php scriptek vannak. A swap annyiból segít, hogy ha csak rövid ideig jön a sok kérés, akkor legfeljebb elkerreg a diszk, a swap hiánya meg annyiból segít, hogy legalább nem küzd a swapeléssel a gép, hanem nyom inkább egy rebootot. :D

:)
Én ezt azért még nem nevezném DoS védelemnek :D

A DoS védelem az, hogy amikor több kérés jön be, akkor azokat ne random/érkezési sorrendben szolgáljam ki, és statisztikai alapon dobáljam el a többletet, mert így a normál felhasználók számára a szolgáltatás gyakorlatilag le fog állni (hiszen ők csak kevés kérést küldenek, a "támadó" meg sokat, így neki a sokból is sokat fogok feldolgozni), hanem mondjuk per IP cím vagy IP tartomány csináljak queue-kat, így ha a kérések zöme kevés helyről jön, akkor tudom a többieket preferálni.

Persze DDoS ellen, na az ellen nem véd... kérem kapcsolja ki :)

1 GB RAM mellett ha beraksz mégegy GB swap-ot, akkor több webkérést fogsz tudni konkurrensen kiszolgálni, magyarul, ha rádöntenek 200 webkérést egyszerre, akkor nem a huszadik után rohadsz le, hanem a harmincötödik után. (Cserébe viszont még őrületbe is swappolod a gépet)

Ha jót akarsz, akkor:
1.) ne swapot adjál a gépnek, hanem még pár GB memóriát. A mai "korszerű" CMS rendszereknél egy-egy oldalgenerálás akár többszáz MB RAM-ot is elvihet, így az 1 GB lehet, hogy csak 4-5 konkurrens kérés kiszolgálására elég,
2.) függetlenül az 1.) ponttól, üzemelj be túlterhelés elleni védelmet. (csak annyi webkérést engedj be, amit ki bírsz szolgálni borulás nélkül, stb.)

Mysql verzió lehetne érdekes, és mysql log-ok.

Szia,

újabban aktív egy malware, ami periódikusan rázúdít random URL kéréseket a távoli webszerverekre. Ilyenkor kapsz egy-két másodperc alatt 100-500 oldalgenerálási kérést, amit nyilván nem tudsz kiszolgálni 1 GB RAM-mal, de nyugi bele, 10 GB-tal sem tudnád, arról nem is beszélve, hogy CPU limites is lennél.

Üzemelj be túlterhelés elleni védelmet.

eleg egyertelmu hogy elfogyott a ram es az oom_killer elovette a baltat es szetcsapott a processek kozott.