LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 09-22-2008, 07:22 AM   #1
granquet
LQ Newbie
 
Registered: Sep 2008
Posts: 2

Rep: Reputation: 0
[sh4][2.6.17] latency peaks with unix sockets on heavy loads


I'm experiencing little glitches when I try to send/receive datas with local sockets under heavy loads.

under normal load it behaves normally, but with load increasing, I get latency peaks once every second.
an Image is worth a thousand words:
http://img255.imageshack.us/img255/3...lottsy7.th.png

X: time elapsed from beginning of execution
Y: call latency

red: under heavy load
green: no load at all

those peeks of 200ms really disturbs me as I'm using the sockets for RPC calls and 200ms (and far more with load increasing) is really too much.

I've been testing various things
enabling/disabling kernel preempt : no effects
active waiting (doing some stuff that consumes cpu) between RPC calls: no effects (even worse)
non blocking sockets doesn't show any improvements and never yield for a EWOULDBLOCK

setting policy to SCHED_FIFO solves the problem: http://img47.imageshack.us/img47/444...fifoxh5.th.png
also, adding a usleep(0) between each call (still with SCHED_NORMAL policy) removes the peaks
from my understanding, usleep(0) puts the task in sleeping mode until the next TICK is emitted and may cause a context switch if there's another runnable task
sched_yield()'ing once every 1000 calls helps also greatly (some peaks still appears here and there though)

upgrading to 2.6.23:

h00rray it solves everything: http://img371.imageshack.us/img371/7...3lldnl6.th.png
still the mean time is a bit higher and provokes a 30% overhead at running the test

but my problem is that I can't upgrade my kernel (yet) and need to find a solution on 2.6.17
I couldn't reproduce the behavior of the 2.6.17 with the 2.6.23, no matter the kernel config

what has changed and could impact on that 'glitch' between the 2 kernels:
-lock classes of AF_UNIX domain has became bh-unsafe :: seems out of suspicion since the peaks hasn't shown up with AF_INET sockets
-scheduler for SCHED_NORMAL tasks has been completely rewritten :: seems to be guilty of the new (improved?) behavior details following: http://kerneltrap.org/node/8059

from now on;
it must be the scheduler, but if an expert eye could confirm.
and if possibly there's a way with the 2.6.17 kernel to get the expected behaviour without hacking/patching (or not too much) the kernel and staying on SCHED_NORMAL policy

or maybe we can discuss about setting my tasks to SCHED_{FIFO,RR}
but I don't think it's a good idea since my tasks are just doing RPCs and much more important things are running on top of that.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Network Request Failure under heavy loads yilez AIX 1 10-19-2007 10:33 AM
Program to forward tcp sockets to unix domain sockets mikepol Linux - Networking 0 09-27-2007 09:49 AM
IPtables - Active UNIX domain sockets LordDaemon Linux - Networking 2 11-12-2006 05:29 AM
Issues with UNIX Local Sockets permission ghoughto Programming 2 12-13-2004 06:38 PM
MINICOM and UNIX SOCKETS [BHBS]=TK Linux - Networking 0 03-15-2002 03:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 06:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration