Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Lags every few minutes
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
FrostyX
n00b
n00b


Joined: 13 Mar 2012
Posts: 57
Location: Czech Republic

PostPosted: Sat Dec 22, 2012 12:33 am    Post subject: [Solved] Lags every few minutes Reply with quote

Hi,
I have this strange problem. When I play some game online I have every few minutes ~10s lag. As well as I am on skype. I cant understand even one word for ~10s. I dont know if problem is when browsing sites. Sometimes I can see longer loading of some site, but i dont know if is it related. I have few windows laptops here and they have no problem. My internet connection is not so bad - http://www.speedtest.net/result/2387291327.png and all ports are opened. Where can be a problem please?

There is device information from ifconfig
Code:
$[FrostyX  ~]-> sudo ifconfig wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.6  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::21c:bfff:fe68:be75  prefixlen 64  scopeid 0x20<link>
        ether 00:1c:bf:68:be:75  txqueuelen 1000  (Ethernet)
        RX packets 1145049  bytes 1041728822 (993.4 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 999212  bytes 130014182 (123.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


This is my wireless card
Code:
$[FrostyX  ~]-> sudo lspci|grep Wireless
03:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)


And there is last few lines from dmesg - http://pastebin.com/zeqNX8B9


Last edited by FrostyX on Sun Jan 06, 2013 5:54 pm; edited 1 time in total
Back to top
View user's profile Send private message
jpc22
Apprentice
Apprentice


Joined: 29 Jan 2012
Posts: 194

PostPosted: Wed Jan 02, 2013 7:10 am    Post subject: Reply with quote

Google tells us you are not the only one having problems with that card.lookin a them point either toward the router or the kernel

Can you tell us more about your router and its relative position to the computer and your wireless signal strenght in % or dbm.

Did the problem show after a kernel update?

I would also check for kernel power management features that could affect the card.

if you happen to have a livedvd laying around i would boot it up and see if the card has the same problems, if not ,check kernel version and drivers.
Back to top
View user's profile Send private message
FrostyX
n00b
n00b


Joined: 13 Mar 2012
Posts: 57
Location: Czech Republic

PostPosted: Wed Jan 02, 2013 3:20 pm    Post subject: Reply with quote

At first I want say, thank you. I am glad you are interested about it.

Quote:
Can you tell us more about your router and its relative position to the computer and your wireless signal strenght in % or dbm.

My router is old Edimax BR-6204Wg. On my hostel is some better router but I don't know name. I'll tell you when I will know it. Network is: few laptops on wifi --> router --> LAN cable going out of our apartment. In both cases I have 100% signal strenght - router is 2 meters from laptop at most (no wall or something between them).

Quote:
Did the problem show after a kernel update?

Maybe. I dont update periodically, but sometimes when I have time. So it should have to be longer time. Couple of months, maybe half year. I think it worked half year ago.

Quote:
I would also check for kernel power management features that could affect the card.

I think it will be better when I show my .config http://pastebin.com/PTTBDdRT

Quote:
if you happen to have a livedvd laying around i would boot it up and see if the card has the same problems, if not ,check kernel version and drivers.

I'll try few live cds and let you know
Back to top
View user's profile Send private message
wcg
Guru
Guru


Joined: 06 Jan 2009
Posts: 588

PostPosted: Wed Jan 02, 2013 6:09 pm    Post subject: Reply with quote

Big lags are sometimes cache flushes. Your kernel caches pages read from
files, either with read() or mmap(). Under memory pressure it will convert
those pages from buffer cache (and/or inode cache, directory cache, etc)
to allocable memory for a new process and/or new file.

If the pages have not been written to by any process, there is no need
to write them back to persistent file storage, and they can simply be
discarded, but if they are "dirty" (changed), then the kernel must write
flush the changes back to persistent file storage (like a hard drive).
Typically, kernels will write back changed file pages every so often
even if nothing else has asked for the memory that they occupy
yet, just to hold down the backlog of "need to be written to disk"
memory pages and protect whatever you are working on from
system crashes, etc.

If the backlog of unwritten dirty pages is big, this can cause a
noticeable pause in other processes when it happens. What
do you have for this value?
Code:

cat /proc/sys/vm/dirty_writeback_centisecs


(If you reduce that value substantially, kernel-scheduled writeback
will happen more often and have smaller numbers of pages to write
to disk when it does. 500 is default, I have read of people lowering
it to 100 or 200.)

I do not know if that will solve your problem, because I do not know
if that is the cause of the behavior you are seeing. One thing to
try, though.
_________________
TIA
Back to top
View user's profile Send private message
Ant P.
Advocate
Advocate


Joined: 18 Apr 2009
Posts: 2510
Location: UK

PostPosted: Wed Jan 02, 2013 7:08 pm    Post subject: Reply with quote

It's unlikely that a hard disk cache flush would cause network lag.
Back to top
View user's profile Send private message
FrostyX
n00b
n00b


Joined: 13 Mar 2012
Posts: 57
Location: Czech Republic

PostPosted: Wed Jan 02, 2013 8:12 pm    Post subject: Reply with quote

Quote:
If you reduce that value substantially, kernel-scheduled writeback
will happen more often and have smaller numbers of pages to write
to disk when it does. 500 is default, I have read of people lowering
it to 100 or 200.


Its crazy but I think it helped. I looked into /proc/sys/vm/dirty_writeback_centisecs and there was 500. I set it to 100 and now I had lags but not that much. Instead of 10s I have 1-3s lags ... What else you think I should check or set?

[EDIT] It was some good aura, cause today it was bad again. So probably /proc/sys/vm/dirty_writeback_centisecs didnt help.
Back to top
View user's profile Send private message
FrostyX
n00b
n00b


Joined: 13 Mar 2012
Posts: 57
Location: Czech Republic

PostPosted: Thu Jan 03, 2013 5:39 pm    Post subject: Reply with quote

On IRC we have found I am using swap, so I have added
Code:
vm.dirty_writeback_centisecs = 200
vm.swappiness=20
into /etc/sysctl.conf and did sudo sysctl -p
Then I did
Code:
sudo swapoff -a
sudo swapon -a

I have checked it, no swap is used while lags

I have stopped cron and statusbars, looked into /var/log/messages and there is nothing (you can see it here http://pastebin.com/pemBnLkJ).

[Edit] Using LAN cable instead of wifi - no lags at all.

What now?
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Fri Jan 04, 2013 5:44 am    Post subject: Reply with quote

Are there any wireless options you can experiment with, especially e.g. disabling power-saving for the wireless card?
Back to top
View user's profile Send private message
wcg
Guru
Guru


Joined: 06 Jan 2009
Posts: 588

PostPosted: Fri Jan 04, 2013 3:12 pm    Post subject: Reply with quote

From your description, the problem is clearly periodic.

What else is periodic besides kernel buffer cache flushes?
Anything specifically in wifi networking that you can
turn off? (Like scanning for new ssids in the local environment?)
_________________
TIA
Back to top
View user's profile Send private message
FrostyX
n00b
n00b


Joined: 13 Mar 2012
Posts: 57
Location: Czech Republic

PostPosted: Sun Jan 06, 2013 5:53 pm    Post subject: Reply with quote

Three days I have been using wicd instead of networkmanager and I had no lags at all. No lags in games, no lags on skype, no lags in web browser.

Cause I used networkmanager only by habbit and now wicd suits me better, I'll stay with it.
I am changing title to [Solved]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum