Howdy, Stranger!

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

Sign In with OpenID
Advertise on LowEndTalk.com

In this Discussion

iotop in openvz

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.

Tagged:

Comments

  • This is accurate when ran inside an openvz container?

    BitAccel - OpenVZ VPS / IRC,VPN,Anything Legal & Unrivaled Support!
  • 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.

    I am no longer affiliated with IPXcore.
  • 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.

    Download and upload speedtest: wget dl.getipaddr.net/speedtest.sh -O- | bash || You can find my other useful scripts on GitHub. Free Proxy Detection || You can contact me on Twitter

  • @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.

    56 VPS tested in real time and counting... (42 active LEB providers)
  • iotop is working fine on both .32 and .18 without any issue.

    *LetBox.Com Amazing Unmetered VPS Boxes
Sign In or Register to comment.