← Back to team overview

zim-wiki team mailing list archive

Re: zim usage of linux threads

 

Jaap,

    thanks for your kind reply.

To just get the number of active threads issue the following command: ps -eT|grep zim|wc -l

For a detailed list use: ps -fT -C zim

By the way: After a quit/start and couple of page views zim-wiki sits at 11 threads. I will keep it under control.

Long and probably not nicely formatted command output follows:

[mario_bezzi@oc7085650101 ~]$ ps -T -o pid,spid,ppid,comm -C  zim
  PID  SPID  PPID COMMAND
 9969  9969     1 zim
 9969  9970     1 zim
 9969  9974     1 zim
 9969  9976     1 zim
 9971  9971  9969 zim
 9971  9972  9969 zim
 9971  9978  9969 zim
 9971 10058  9969 zim
 9971 10127  9969 zim
 9975  9975  9969 zim
 9975  9977  9969 zim

Current file handles:
[mario_bezzi@oc7085650101 ~]$ ls -l -G  /proc/9969/fd
lr-x------. 1 mario_bezzi 64 Oct 24 18:52 0 -> /dev/null
lrwx------. 1 mario_bezzi 64 Oct 24 18:52 1 -> /tmp/zim-mario_bezzi/zim-daemon.log
lrwx------. 1 mario_bezzi 64 Oct 24 18:55 11 -> socket:[7739599]
lrwx------. 1 mario_bezzi 64 Oct 24 18:55 12 -> socket:[7739600]
lrwx------. 1 mario_bezzi 64 Oct 24 18:55 14 -> socket:[7739655]
lrwx------. 1 mario_bezzi 64 Oct 24 18:55 15 -> socket:[7739656]
lrwx------. 1 mario_bezzi 64 Oct 24 18:52 2 -> /tmp/zim-mario_bezzi/zim-daemon.log
lrwx------. 1 mario_bezzi 64 Oct 24 18:52 3 -> /dev/null
lrwx------. 1 mario_bezzi 64 Oct 24 18:52 4 -> /tmp/zim-mario_bezzi/zim-daemon.log
lr-x------. 1 mario_bezzi 64 Oct 24 18:52 5 -> pipe:[7739587]
l-wx------. 1 mario_bezzi 64 Oct 24 18:52 6 -> pipe:[7739587]
lrwx------. 1 mario_bezzi 64 Oct 24 18:55 7 -> socket:[7739591]

[mario_bezzi@oc7085650101 ~]$ ls -l -G  /proc/9971/fd
total 0
lr-x------. 1 mario_bezzi 64 Oct 24 18:54 0 -> /dev/null
l-wx------. 1 mario_bezzi 64 Oct 24 18:54 1 -> /tmp/zim-mario_bezzi/zim-daemon.log lrwx------. 1 mario_bezzi 64 Oct 24 18:54 10 -> /home/mario_bezzi/.cache/zim/notebook-home_mario_bezzi_Documents_Wikis/index.db
lrwx------. 1 mario_bezzi 64 Oct 24 18:54 11 -> socket:[7739599]
lrwx------. 1 mario_bezzi 64 Oct 24 18:54 12 -> socket:[7739600]
lrwx------. 1 mario_bezzi 64 Oct 24 18:54 13 -> socket:[7739609]
lrwx------. 1 mario_bezzi 64 Oct 24 18:54 14 -> socket:[7739603]
lr-x------. 1 mario_bezzi 64 Oct 24 18:54 15 -> pipe:[7739607]
l-wx------. 1 mario_bezzi 64 Oct 24 18:54 16 -> pipe:[7739607]
lrwx------. 1 mario_bezzi 64 Oct 24 18:54 17 -> socket:[7739625]
lr-x------. 1 mario_bezzi 64 Oct 24 18:54 18 -> inotify
lr-x------. 1 mario_bezzi 64 Oct 24 18:54 19 -> pipe:[7739735]
l-wx------. 1 mario_bezzi 64 Oct 24 18:54 2 -> /tmp/zim-mario_bezzi/zim-daemon.log
l-wx------. 1 mario_bezzi 64 Oct 24 18:54 20 -> pipe:[7739735]
lrwx------. 1 mario_bezzi 64 Oct 24 18:54 21 -> socket:[7739739]
lrwx------. 1 mario_bezzi 64 Oct 24 18:54 22 -> /home/mario_bezzi/.cache/event-sound-cache ..snip..
lr-x------. 1 mario_bezzi 64 Oct 24 18:54 23 -> pipe:[7745179]
l-wx------. 1 mario_bezzi 64 Oct 24 18:54 24 -> pipe:[7745179]
lr-x------. 1 mario_bezzi 64 Oct 24 18:54 3 -> /dev/null
l-wx------. 1 mario_bezzi 64 Oct 24 18:54 4 -> /tmp/zim-mario_bezzi/zim-daemon.log
lr-x------. 1 mario_bezzi 64 Oct 24 18:54 5 -> pipe:[7739587]
l-wx------. 1 mario_bezzi 64 Oct 24 18:54 6 -> pipe:[7739587]
lrwx------. 1 mario_bezzi 64 Oct 24 18:54 7 -> socket:[7739591]
lr-x------. 1 mario_bezzi 64 Oct 24 18:54 8 -> /dev/null
lrwx------. 1 mario_bezzi 64 Oct 24 18:54 9 -> socket:[7739597]

[mario_bezzi@oc7085650101 ~]$ ls -l -G  /proc/9975/fd
total 0
lr-x------. 1 mario_bezzi 64 Oct 24 18:55 0 -> /dev/null
l-wx------. 1 mario_bezzi 64 Oct 24 18:55 1 -> /tmp/zim-mario_bezzi/zim-daemon.log
lrwx------. 1 mario_bezzi 64 Oct 24 18:55 10 -> socket:[7739653]
lrwx------. 1 mario_bezzi 64 Oct 24 18:55 11 -> socket:[7739599]
lrwx------. 1 mario_bezzi 64 Oct 24 18:55 12 -> socket:[7739600]
lrwx------. 1 mario_bezzi 64 Oct 24 18:55 14 -> socket:[7739655]
lrwx------. 1 mario_bezzi 64 Oct 24 18:55 15 -> socket:[7739656]
lrwx------. 1 mario_bezzi 64 Oct 24 18:55 17 -> socket:[7739659]
lr-x------. 1 mario_bezzi 64 Oct 24 18:55 18 -> pipe:[7739663]
l-wx------. 1 mario_bezzi 64 Oct 24 18:55 19 -> pipe:[7739663]
l-wx------. 1 mario_bezzi 64 Oct 24 18:55 2 -> /tmp/zim-mario_bezzi/zim-daemon.log
lr-x------. 1 mario_bezzi 64 Oct 24 18:55 3 -> /dev/null
l-wx------. 1 mario_bezzi 64 Oct 24 18:55 4 -> /tmp/zim-mario_bezzi/zim-daemon.log
lr-x------. 1 mario_bezzi 64 Oct 24 18:55 5 -> pipe:[7739587]
l-wx------. 1 mario_bezzi 64 Oct 24 18:55 6 -> pipe:[7739587]
lrwx------. 1 mario_bezzi 64 Oct 24 18:55 7 -> socket:[7739591]
lr-x------. 1 mario_bezzi 64 Oct 24 18:55 8 -> /dev/null
lrwx------. 1 mario_bezzi 64 Oct 24 18:55 9 -> socket:[7739649]



On 10/24/2014 04:44 PM, Jaap Karssenberg wrote:
Hi Mario,

I would not consider that to be normal. But to be honest I also never did a real benchmark on this.

Zim uses threads mostly to make IO a bit more responsive, but those should threads should be short lived and you would not see many of them in parallel.

One thing to try is to also check the open file handles and see if there are so many of them for zim as well.

Of course there might be a bug in cleaning up threads that could cause them to remain active. Would be worth while to look into. Can you share with me how you log the number of open threads?

Regards,

Jaap


On Fri, Oct 24, 2014 at 4:06 PM, mario@tiscali <mbezzi@xxxxxxxxxx <mailto:mbezzi@xxxxxxxxxx>> wrote:

    Hello,

        I run zim-wiki 0.62 on RedHat Linux 6.5. Happily.

    Lately my system started experiencing strange "fork failed -
    resource temporarily unavailable" problems that I see as unrelated
    to zim-wiki.

    Still, trying to diagnose these, I noticed that running a single
    instance of zim-wiki consumes, on my system, 110 linux threads
    (under the same process). It is the heaviest thread consumer on my
    system.

    Should I consider this normal?

    This is with python 2.6.6 (r266:84292).

    Thanks in advance,
    mario

    _______________________________________________
    Mailing list: https://launchpad.net/~zim-wiki
    <https://launchpad.net/%7Ezim-wiki>
    Post to     : zim-wiki@xxxxxxxxxxxxxxxxxxx
    <mailto:zim-wiki@xxxxxxxxxxxxxxxxxxx>
    Unsubscribe : https://launchpad.net/~zim-wiki
    <https://launchpad.net/%7Ezim-wiki>
    More help   : https://help.launchpad.net/ListHelp




Follow ups

References