0

My application is doing some heavy IO on raw /dev/sdb block device using pread64/pwrite64. Sometimes it doing just fine. Call to pread64/pwrite64 usually takes as little as 50-100us. But sometimes it takes a whole lot more, up to several seconds.

What can you recommend to find the cause of such problem?

Sergej Zagursky
  • 453
  • 4
  • 16

2 Answers2

0

I have not used it but I have heard about a tool called latencytop.

Zan Lynx
  • 53,022
  • 10
  • 79
  • 131
  • latencytop is not useful for my case. I already know what particular operations are causing hangs. But I want to know the cause of such hangs. But thank you anyway for mentioning such a tool. I didn't know about it. – Sergej Zagursky Jul 01 '11 at 07:30
  • @Sergej: If you dig deeper into it, it looks like the kernel support for latencytop stores a full backtrace, not just the system call. With that you should be able to see what kernel functions were called during the slow pread64. – Zan Lynx Jul 01 '11 at 07:37
  • How to do that? I haven't found any info on it. – Sergej Zagursky Jul 04 '11 at 14:17
0

When it's hung like that, grab a stackshot. Another option is pstack or lsstack. And as @Zan pointed out, latencytop could also give you that information.

That might not fully answer your question, but at least you'll know with certainty what it was trying to do when it was hung.

Community
  • 1
  • 1
Mike Dunlavey
  • 40,059
  • 14
  • 91
  • 135