"top" for plugins to view CPU usage

Discussion in 'Archived: Plugin Requests' started by ratty, Jul 9, 2011.

  1. Offline

    ratty

    Or maybe there's a way to get this from java? But my server is a quad core xeon nahalem with 16G of RAM, but after about 10 players I get the "can't keep up" spam, so I know it should be able to handle more. Its probably one of the 57 plugins I use. Ive tried disabling any that seem like they might cause lag but its still lagging.

    So what I'm suggesting is if someone could make a plugin that lets you see how much CPU each plugin is using. This would also help server admins give better information when reporting bugs to plugins, so we don't go blaming one plugin's CPU consumption on another plugin.
    Or is there maybe a way to use a java debugger to figure that out? I don't know enough about java to do that though.
     
  2. Offline

    Andred

    I've been researching various CPU/memory management options, and I just can't seem to find anything that allows me to get CPU/memory usage of individual threads. (Actually, I think Java's built-in Attach API can do something like that, but I couldn't get it to work)

    I was considering writing a plugin that could find the memory usage of all the other plugins running on a server, but I think that might require all of the other plugin authors to include something in their code to tell my plugin what's going on, which would be annoying. I'm definitely going to look into it though.
     
  3. Offline

    Supersam654

    I know you have a super amazing server, but have you considered what happens when people are flying around? When flying at maximum speed with Zombe's fly mod, your server has to load a TON of chunks! All you need is 1, MAYBE 2 people flying for 30 seconds straight and your server probably won't be able to "Keep up". Then again, I don't know if flying is disabled or not.

    Sam
     
  4. Offline

    ratty

    Good thought, but I get the messages even when there's only 10 people on, I tp'd to every single person and they were all just in various places building things or hanging out, nobody was flying. I know if new chunks get generated, that lags things everytime but I just accept that as a fact of life. And now that I have a plugin to let me know when chunks get made, I can at least rule that out with confidence.

    I'm a bit ignorant about how this works, so I'm probably derping this, but for threads, I don't care as much about anything that is in another thread, I have several unused CPU cores on the server, so its just that stuff that has to run every tick and that holds things up is mostly what I want to see what its doing. I'm guessing this kind of thing would have to be written into Bukkit itself to really work, with just measuring time before and after each plugin gets time, though I bet it would create extra load just being on, and most people really don't need that feature.

    And I had another idea, maybe something that can report on chunks loaded and unloaded per minute. Anything to help find the cause of high CPU load, if I see a lot of chunk loading going on, maybe someone is using flymod excessively or teleporting around a lot.
     
  5. Offline

    Andred

    I've made a good bit of progress as far as this is concerned... sort of.

    I've managed to use the Attach API to get all sorts of monitoring information about bukkit, like heap memory statistics, thread statuses, and plenty of other stuff I haven't even touched yet. But I'm afraid it's up to the Bukkit team to implement some way of seeing just how much memory/CPU each plugin is using.
     
  6. Offline

    Bronski

    Yeah this would be very welcome. I have 30 plugins and at least one of them is misbehaving but I've no idea how to tell other than uninstalling each one and trying to get everyone to log right back on to test (zzzzzzzzzzzzzz).
     

Share This Page