Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

iotop in openvz

haphanhaphan Member
edited August 2012 in Help

Hi,

Does anyone have a patch for iotop? Mine is not working in openvz container. (python 2.6.6, iotop 1.4.2, squeeze x86)

Or if you have an alternative tool, let me know.

Cheers.

Comments

  • This is accurate when ran inside an openvz container?

  • haphanhaphan Member
    edited August 2012

    @Corey said: This is accurate when ran inside an openvz container?

    I even failed to start iotop in openvz container.

    Traceback (most recent call last):

    File "/usr/bin/iotop", line 16, in
    main()
    File "/usr/local/lib/python2.6/dist-packages/iotop/ui.py", line 571, in main
    main_loop()
    File "/usr/local/lib/python2.6/dist-packages/iotop/ui.py", line 561, in
    main_loop = lambda: run_iotop(options)
    File "/usr/local/lib/python2.6/dist-packages/iotop/ui.py", line 465, in run_iotop
    return curses.wrapper(run_iotop_window, options)
    File "/usr/lib/python2.6/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
    File "/usr/local/lib/python2.6/dist-packages/iotop/ui.py", line 455, in run_iotop_window
    taskstats_connection = TaskStatsNetlink(options)
    File "/usr/local/lib/python2.6/dist-packages/iotop/data.py", line 146, in __init__
    self.family_id = controller.get_family_id('TASKSTATS')
    File "/usr/local/lib/python2.6/dist-packages/iotop/genetlink.py", line 69, in get_family_id
    m = GeNlMessage.recv(self.conn)
    File "/usr/local/lib/python2.6/dist-packages/iotop/genetlink.py", line 51, in recv
    msg = conn.recv()
    File "/usr/local/lib/python2.6/dist-packages/iotop/netlink.py", line 229, in recv
    raise err
    OSError: Netlink error: No such file or directory (2)

    Some people reported same issue here and here

  • haphanhaphan Member
    edited August 2012

    Nobody has this problem?

  • Well what file or directory does /usr/local/lib/python2.6/dist-packages/iotop/netlink.py try to open in line 229?

  • haphanhaphan Member
    edited August 2012
    def recv(self):
            contents, (nlpid, nlgrps) = _nl_recv(self.descriptor)
            msglen, msg_type, flags, seq, pid = struct.unpack("IHHII",
                                                              contents[:16])
            msg = Message(msg_type, flags, seq, contents[16:])
            msg.pid = pid
            if msg.type == NLMSG_ERROR:
                errno = -struct.unpack("i", msg.payload[:4])[0]
                if errno != 0:
                    err = OSError("Netlink error: %s (%d)" % (
                                                         os.strerror(errno), errno))
                    err.errno = errno
                    raise err
            return msg
    

    I have no idea what this script is trying to read.
    I am not a python developer so please bear with me :(

    This post quickly becomes number 1 search result on google. I am a bit surprised nobody had this before.

  • DamianDamian Member
    edited August 2012

    What's the output of uname -r?

    @haphan said: This post quickly becomes number 1 search result on google.

    Web 2.0.

  • alegeekalegeek Member
    edited August 2012

    Looks like your host is running an old kernel.

  • haphanhaphan Member
    edited August 2012

    @ghoulnet said: Looks like your host is running an old kernel.

    @Damian said: What's the output of uname -r?

    hmm, does not seem old.

    Host and container kernel: Linux server 2.6.32-11-pve

  • I've tried iotop on kernel 2.6.32-042stab059.7, and it doesn't work as well.
    But it works fine on 2.6.18-308.el5.028stab099.3. It seems that the new OpenVZ kernel doesn't support iotop?!

  • haphanhaphan Member
    edited August 2012

    @VictorZhang said: I've tried iotop on kernel 2.6.32-042stab059.7, and it doesn't work as well.

    But it works fine on 2.6.18-308.el5.028stab099.3. It seems that the new OpenVZ kernel doesn't support iotop?!

    Yep I think it is the case too.

    There is a patch for iotop 1.4.2 in openvz here. I tried and failed to apply this patch.

    Can some one give it a shot?

  • I've had this problem before, all I did was remove that specific python module (can't remember what it was called) using apt-get and re-installed it using apt-get.

  • @haphan said: There is a patch for iotop 1.4.2 in openvz here. I tried and failed to apply this patch.

    Tried to apply this patch to iotop 1.4.2, also failed with the same error message :-(

  • Sorry, necromancing this thread

    Anyone has an idea on how to get this working for .32?

    Btw, the patch applies successfully, but doesn't work.

  • I tried to write such a script a couple of days ago.
    Most disk IO stat tools use /proc/diskstats or /sys/block, both are not available inside OpenVZ. This is due to the nature of simfs so I don't think you can have something like iotop inside OpenVZ.
    OTOH, /proc/PROCESS_ID/io is there so you can probably build something around it but this is not the same information.

  • letboxletbox Member, Patron Provider

    iotop is working fine on both .32 and .18 without any issue.

Sign In or Register to comment.