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
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-01-2007, 01:27 AM   #1
cdcshu
Member
 
Registered: Jul 2006
Location: Shanghai
Distribution: Fedora, OpenSUSE
Posts: 31

Rep: Reputation: 16
Question Multi-thread execution efficiency problem


Hello,

I met a puzzle on coding a zero data program for many disks under a multi-thread case. The low-level component is written by C && SCSI WRITE and it is called by a JAVA mulit-thread program(One Disk one thread).

I found that 15 threads around can reach to 60MB/Sec Zero Speed whereas 30 threads around could only get 30MB/Sec or so. That's to say, the more threads involved, the slower speed it could get. On the same time, CPU load was sticked to 32-37% and Mem at 0.6% only no matter 15 or 30 threads running[TOP Showed]. It seems that there is still some room to improve. But I have no idea where I SHOULD fix. Could anyone shed a light on it

Thanks in advance,

cdcshu

Last edited by cdcshu; 08-01-2007 at 01:30 AM.
 
Old 08-01-2007, 12:52 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,340

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
"On the same time, CPU load was sticked to 32-37% and Mem at 0.6% only no matter 15 or 30 threads running[TOP Showed]. It seems that there is still some room to improve. But I have no idea where I SHOULD fix."

The fact that the CPU maxed at 32-37% means that the CPU is not the critical resource. The fact that the Mem maxed at 0.6% means that the Mem is not the critical resource. Check the other components that you are using to see if one of them hits 100% usage. Some possible critical resources are disk arm movement, network speed, and video buffer access.

-----------------
Steve Stites
 
Old 08-01-2007, 01:47 PM   #3
studioj
Member
 
Registered: Oct 2006
Posts: 460

Rep: Reputation: 31
there are various scheduling algorithms to choose from in the kernel config.
some grant a lower level of latency in getting to interupts others give faster throughput and a higher level of latency. You can also try different levels of hardware latency "setpci".
different size buffers might effect burst size as well.
also remember you have realtime threads if you need it to controll scheduling.

Last edited by studioj; 08-01-2007 at 01:49 PM.
 
Old 08-02-2007, 12:46 AM   #4
cdcshu
Member
 
Registered: Jul 2006
Location: Shanghai
Distribution: Fedora, OpenSUSE
Posts: 31

Original Poster
Rep: Reputation: 16
Thumbs up Good explaination:-)

Hello jailbait,

I am clearer about TOP result from your notes. One of the critical resources is Disk itself, I bet. In some degree, SCSI WRITE(10) I used have stressed the disk to reach its max write speed because SCSI Command works on disk directly and there is no other barrier to be involved. If really have, PCIe HBA card(Disk Channel) could be considered. However, I have no clue on it.

Like studioj suggested, for the moment, I can give it a shot on kernel config and choose another scheduling algorithms. In my case, IO process performance is more important.

Thanks for both of your nice reply

cdcshu
 
  


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
pthreads.c - summary of thread execution times h/w Programming 1 06-15-2007 03:23 PM
global integer in the multi-thread application lordofring Programming 1 08-23-2005 09:36 PM
Multi-Thread/Process Pipes JanusPaul Programming 2 02-27-2005 02:52 PM
Kernel Thread Execution Context and PID ratwings Linux - Newbie 0 02-11-2005 04:06 AM
multi-thread VS multi-process ltcstyle Programming 3 12-04-2004 06:53 PM

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

All times are GMT -5. The time now is 02:35 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