tags:

views:

226

answers:

2

I have a web page containing a table of jobs running on my system. As these jobs finish or change state the table needs to reflect the changes.

Currently I refresh the whole table via AJAX every 8 seconds. This works fine for a certain number of jobs, but causes performance issues with very high (~100) job loads, eventually causing browsers to lock up.

I am using struts2's sx:div to perform theses updates and I believe it is parsing the returned table each time to search for widgets, turning this off breaks functionality.

I think refreshing just the status column would help greatly with this as the data returned will be much smaller, but I am unsure how this will work.

I'm open to using something other than the struts tag to perform this. So in essence I am asking is there a simple way to just refresh a column of a table.

Thanks in advance.

A: 

When you say "I refresh the whole table every 8 seconds", do you mean that you retrieve the entire json data every 8 seconds? Because if that's the case, it's normal to have slow-downs...

I would keep track of changes on the server side, and send a small "same table" msg if the query comes in whereas no data has changed. Only send back the table data if something has changed on the server side.

m_oLogin
+1  A: 

Updating only the texts in status column should definetely perform better than re-rendering the whole table. The saving from bandwidth probably isn't that big win. But that's just my gut feeling - you should of course check and measure what works best for you.

When the status of only some rows changes in each update, then updating only the changed rows should also improve performance.

Also, as m_oLogin suggested, you can consider sending only the deltas of the changes. Although in my experience it's not the easiest thing to get right, so I wouldn't start from there.

Rene Saarsoo