0

What is the meaning of WCHAN="semtim"?

ps -ylC httpd

S   UID   PID  PPID  C PRI  NI    RSS     SZ WCHAN  TTY      TIME CMD
S     0 25330     1  0  78   0  16168 170563 -      ?    00:00:14 httpd
R    48 16566 25330  4  76   0  36864 174156 -      ?    00:00:02 httpd
S    48 31450 25330  2  75   0 109992 186745 -      ?    00:02:24 httpd
S    48 31460 25330  2  75   0 115724 186745 semtim ?    00:02:11 httpd
S    48 23069 25330  1  75   0 116812 186745 semtim ?    00:02:13 httpd
S    48 12335 25330  2  75   0 117444 186745 -      ?    00:03:48 httpd
S    48 23130 25330  1  75   0 118616 200530 -      ?    00:01:54 httpd
S    48 23205 25330  2  77   0 119044 187769 semtim ?    00:02:50 httpd
S    48 23138 25330  2  75   0 120436 186745 semtim ?    00:02:39 httpd
S    48 23194 25330  1  75   0 120544 186745 semtim ?    00:02:16 httpd
S    48 12309 25330  2  75   0 120604 186745 semtim ?    00:03:00 httpd
S    48 23204 25330  2  75   0 120848 186489 semtim ?    00:02:41 httpd
S    48 23202 25330  3  76   0 121584 186745 semtim ?    00:03:45 httpd
S    48 31454 25330  2  75   0 122516 200530 semtim ?    00:02:12 httpd

The server in question is a Red Hat 4.1.2-52 system (Kernel 2.6.18), running an Apache 2.2.3 with mpm_prefork module.

Looking at the boot/System.map-2.6.18-308.1.1.el5 file I can find:

ffffffff80122b12 T compat_sys_semtimedop
ffffffff80125203 T sys_semtimedop

but I'm neither sure if one of those is semtim, nor what they or semtim mean at all.

1 Answers1

3

It is a semtimedop system call.

A semaphore is a value which which is used to maintain synchronization between processes.

In your example "semtimedop" means apache is waiting for the semaphore to become zero with a wait occurring until the value does become zero or a timeout occurs and thus the process is blocking.

You have not mentioned whether or not this is a problem for you so theres not much more than that I can add.

Matthew Ife
  • 23,357
  • 3
  • 55
  • 72
  • Thank you. I'm not sure whether it's a problem. I'm no admin, but got the job to try to optimize the apache processes (lucky me^^). I was wondering what `semtim` means and if these processes could be the apache spare servers waiting for requests. Can I say an apache process waiting for a semaphore is _idle_? – Jürgen Thelen May 08 '12 at 10:47
  • Yes, typically the kernel will yeild such a process until such time the semaphore is ready. – Matthew Ife May 08 '12 at 13:43