I have an apache/ubuntu server serving a php website. Its 2gb/ram. Google Analytics is showing 4 users online but my network I/O is at 8/mb sec and CPU close to 100%.
Where should i start looking for the problem?
I have an apache/ubuntu server serving a php website. Its 2gb/ram. Google Analytics is showing 4 users online but my network I/O is at 8/mb sec and CPU close to 100%.
Where should i start looking for the problem?
Your question is a little vague but let me see if I can give you a hand with some basic diagnostics.
sudo apt-get install htop
sudo apt-get install nethogs
CPU%
.sudo nethogs eth0
If you don't see that list and there's an error about eth0, we just have to figure out what kind of device you're connected through
ifconfig
into the terminal and then look for your ip address and see which device coincides with itFor example mine might look something like below. If I was looking for my local ip address 192.168.1.2, I'd see that it's under wlan0. I would then run sudo nethogs wlan0
.
me@mycomputer:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 50:50:50:50:50:50
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:41 Base address:0xc000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:174495 errors:0 dropped:0 overruns:0 frame:0
TX packets:174495 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:34273278 (34.2 MB) TX bytes:34273278 (34.2 MB)
wlan0 Link encap:Ethernet HWaddr 78:44:76:93:e0:19
inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::fe80:fe80:fe80:fe80/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8745176 errors:0 dropped:0 overruns:0 frame:0
TX packets:4565824 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10226861873 (10.2 GB) TX bytes:519927133 (519.9 MB)
If that trick doesn't work for you, you might try the following shots in the dark
sudo nethogs wlan0
(if wireless)sudo nethogs eth0
sudo nethogs venet0:0
Anyway, hope this helps you identify what's causing trouble.
In the future when asking questions, you might give us clues as to what you've tried, what you think your struggling with or how much you know about the subject at hand.