Forums

Mike
Mike
Offline
Resolved
0 votes
So after I setup clearos i left it alone for a while. The other day I needed to add a new rule and it was taking forever to pull up the web interface. I decided to ssh in and after waiting a long time as well to get logged in i was finally able to check the memory usage to find out I had 70 mb remaining. Top showed that mysql was uing 99% of memory. After killing the process the memory usage went to about 1 gb.

Here is top about an hour after i started the system-mysqld service again.

Tasks: 147 total, 1 running, 146 sleeping, 0 stopped, 0 zombie
Cpu(s): 1.9%us, 1.3%sy, 0.1%ni, 9.7%id, 86.7%wa, 0.0%hi, 0.2%si, 0.0%st
Mem: 1913876k total, 1844620k used, 69256k free, 3804k buffers
Swap: 2031608k total, 640724k used, 1390884k free, 440272k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
8149 system-m 20 0 1716m 609m 4388 S 3.9 32.6 5:11.87 system-mysqld


This is free -m

total used free shared buffers cached
Mem: 1869 1802 66 0 3 430
-/+ buffers/cache: 1367 501
Swap: 1983 625 1358


Here are the list of mysql processes:

mysql> show processlist;
+-----+---------+-----------------+---------+---------+------+----------+------------------------------------------------------------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+---------+-----------------+---------+---------+------+----------+------------------------------------------------------------------------------------------------------+
| 72 | reports | localhost:55060 | reports | Query | 7 | update | INSERT INTO `network_detail_external` (stamp_updated, stamp_inserted, ip_dst, packets, bytes) VALUES |
| 73 | reports | localhost:55061 | reports | Query | 4 | update | INSERT INTO `network_detail_external` (stamp_updated, stamp_inserted, ip_src, packets, bytes) VALUES |
| 93 | reports | localhost:55081 | reports | Query | 1 | Updating | UPDATE `network_detail_external` SET packets=packets+1, bytes=bytes+151, stamp_updated=NOW() WHERE F |
| 95 | reports | localhost:55083 | reports | Query | 0 | update | INSERT INTO `network_detail_external` (stamp_updated, stamp_inserted, ip_src, packets, bytes) VALUES |
| 105 | reports | localhost:55099 | reports | Query | 0 | update | INSERT INTO `network_detail_external` (stamp_updated, stamp_inserted, ip_dst, packets, bytes) VALUES |
| 106 | reports | localhost:55100 | reports | Query | 1 | Updating | UPDATE `network_detail_external` SET packets=packets+1, bytes=bytes+53, stamp_updated=NOW() WHERE FR |
| 118 | reports | localhost:55121 | reports | Query | 0 | Updating | UPDATE `network_detail_external` SET packets=packets+1, bytes=bytes+53, stamp_updated=NOW() WHERE FR |
| 120 | reports | localhost:55123 | reports | Query | 1 | Updating | UPDATE `network_detail_external` SET packets=packets+1, bytes=bytes+151, stamp_updated=NOW() WHERE F |
| 129 | root | localhost | NULL | Query | 1 | NULL | show processlist |
| 131 | reports | localhost:55138 | reports | Query | 0 | Updating | UPDATE network_detail SET ip='???', hostname='192.168.1.148', username='', device_vendor='', device |
+-----+---------+-----------------+---------+---------+------+----------+------------------------------------------------------------------------------------------------------+
10 rows in set (0.72 sec)



System Details

Item Value
Version ClearOS Community release 6.5.0 (Final)
Kernel Version 2.6.32-431.17.1.v6.x86_64
System Time Thu Jun 26 15:56:30 CDT 2014
CPU Model Intel(R) Pentium(R) Dual CPU E2140 @ 1.60GHz
Memory Size 1.83 GB
Uptime 20 Days 20.4 Hours
Load 4.41 4.16 3.73


I ran into this issue over a month back, and went ahead and thew an extra gig of ram bringing it up to 2 gb, i would figure is plenty for a router.... i guess maybe not?

Any suggestions would be great.

Thanks!
Thursday, June 26 2014, 09:00 PM
Share this post:
Responses (2)
  • Accepted Answer

    Mike
    Mike
    Offline
    Monday, June 30 2014, 03:00 PM - #Permalink
    Resolved
    0 votes
    Thank you for your response Tim!

    Unless Zarafa is part of the vanilla install, no I don't store mail on the server.

    Currently it is only acting as a gateway, no AV, content filtering or proxy. Just dhcp, and routing.

    As for the drive thrashing, I'm not sure how I would check that or resolve it. The box currently has a standard 7200 rpm 230GB seagate. with 200+gb free.


    [root@gateway ~]# df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/mapper/vg_gateway-lv_root
    227G 7.9G 208G 4% /
    tmpfs 935M 0 935M 0% /dev/shm
    /dev/sda1 485M 55M 406M 12% /boot



    without system-mysqld running, this is what top looks like

    top - 09:59:36 up 3 days, 13:05, 2 users, load average: 0.00, 0.12, 0.38
    Tasks: 133 total, 1 running, 132 sleeping, 0 stopped, 0 zombie
    Cpu(s): 0.3%us, 0.3%sy, 0.0%ni, 99.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
    Mem: 1913876k total, 1815924k used, 97952k free, 9972k buffers
    Swap: 2031608k total, 154652k used, 1876956k free, 614748k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    1 root 20 0 21448 988 788 S 0.0 0.1 0:00.77 init
    2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
    3 root RT 0 0 0 0 S 0.0 0.0 0:00.35 migration/0
    4 root 20 0 0 0 0 S 0.0 0.0 0:04.58 ksoftirqd/0
    5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
    6 root RT 0 0 0 0 S 0.0 0.0 0:00.29 watchdog/0
    7 root RT 0 0 0 0 S 0.0 0.0 0:00.38 migration/1
    8 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/1
    9 root 20 0 0 0 0 S 0.0 0.0 0:02.31 ksoftirqd/1
    10 root RT 0 0 0 0 S 0.0 0.0 0:00.16 watchdog/1
    11 root 20 0 0 0 0 S 0.0 0.0 0:30.31 events/0
    12 root 20 0 0 0 0 S 0.0 0.0 0:19.81 events/1
    13 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cgroup
    14 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khelper
    15 root 20 0 0 0 0 S 0.0 0.0 0:00.00 netns
    16 root 20 0 0 0 0 S 0.0 0.0 0:00.00 async/mgr
    17 root 20 0 0 0 0 S 0.0 0.0 0:00.00 pm
    18 root 20 0 0 0 0 S 0.0 0.0 0:00.96 sync_supers
    19 root 20 0 0 0 0 S 0.0 0.0 0:00.85 bdi-default



    Thank again.
    The reply is currently minimized Show
  • Accepted Answer

    Monday, June 30 2014, 01:07 PM - #Permalink
    Resolved
    0 votes
    Linux will use all available RAM to cache and otherwise improve the system performance...although admittedly your system-mysqld usage seems a bit high

    Do you use Zarafa which stores mail in MySQL?

    Interstingly your load usages are very high! they should sit below 1 usually, and near zero for a predominantly idle system. Your TOP output suggests a high %wa state which is waiting for the drive IO to complete. Is your harddrive thrashing? what other services are you running (AV? content filtering? proxy?) your SWAP space is increasing so you probably still don't have enough RAM
    The reply is currently minimized Show
Your Reply