pycs-devel archive weblog

A blog for archiving the pycs-devel mailing list

2003-10-25

Phillip Pearson: [PyCS-devel] UserSpaceUsed changes

Hi guys,

I just checked in some changes to PyCS, to do with monitoring how much
space people are using. Changes:

- added new field to the user record in the database, 'bytesused'
(integer)

- moved the used-space calculations from xmlStorageSystem.py to
pycs_settings.py

- got xmlStorageSystem.saveMultipleFiles and .deleteMultipleFiles to
cache the amount of space used in the 'bytesused' field, and changed
other xmlStorageSystem fields to use the cached value rather than
working it out each time.

- got users.py to display the current usage and allow sorting by usage

The result of all this is that now you can visit:

http://www.pycs.net/system/users.py?sort=space

... then scroll to the bottom and see who is using the most space on
your server. I was pleasantly surprised to see that nobody's using
_that_ much space on pycs.net :-)

Cheers,
Phil

P.S. I think I cracked the problem that was causing pycs.net to hang.
It looks like that happens when you stop the server process, then
restart it, but without waiting for it to die properly. I've changed
my stop script to keep sending it KILL signals until it's really gone,
and the server hasn't hung since.

It looks like the referrer pages are taking a little while to
generate, as well, so search engines hitting the referrer pages could
be causing trouble. Let's see how this goes...