0

I noticed processes are taking a very long time to start (100ms).

My CPUs are mostly idle but has load on it.

top - 16:59:29 up 60 days, 23:49,  1 user,  load average: 6.38, 6.28, 5.95
Tasks: 544 total,   4 running, 539 sleeping,   1 stopped,   0 zombie
Cpu(s):  7.0%us,  3.8%sy,  1.9%ni, 80.2%id,  6.6%wa,  0.0%hi,  0.6%si,  0.0%st

Curl timings:

-bash-4.1$ time curl
curl: try 'curl --help' or 'curl --manual' for more information
real    0m0.097s
user    0m0.092s
sys 0m0.004s

How can I track down why this is taking so long?

0

2 Answers 2

1

strace is your friend

$ strace -t ps

Look for the entry that has the biggest delta in time.

1
  • it looks like either munmap or reading fips_enabled is the slowest step. or whatever non-syscall happens in between? 20:49:23.328966 munmap(0x7effeb090000, 4096) = 0 20:49:23.387550 open("/proc/sys/crypto/fips_enabled", O_RDONLY) = 3 May 1, 2016 at 20:52
1

It's disk I/O. Repeat the command immediately and you'll notice it takes much less time.

$ time curl
curl: try 'curl --help' or 'curl --manual' for more information

real        0m0.108s
user        0m0.004s
sys         0m0.004s

$ time curl
curl: try 'curl --help' or 'curl --manual' for more information

real        0m0.007s
user        0m0.004s
sys         0m0.003s

$ time curl
curl: try 'curl --help' or 'curl --manual' for more information

real        0m0.007s
user        0m0.004s
sys         0m0.003s
1
  • I tried this in a loop, it stays > 90ms even after 100 iterations. May 1, 2016 at 20:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .