Problems with pstore.rb under mod_ruby

B

bhoward

I have a web application that runs under mod_ruby and uses a pstore
for persistant storage.

From time to time (apparently when the system is under heavy load),
the pstore database gets corrupted or left in a state where the pstore
db file (call it foo.pstore) is missing but the backup (foo.pstore~)
is still around.

I can generally exercise the problem by rapidly hitting reload so I'm
assuming that the ruby interpreter running the pstore code is getting
interrupted while performing an update and leaving things in an
indeterminate state.

What's do folks here recommend as the right way to fix this problem?

A second, possibly related question is...is there a way to reduce the
overhead I'm incurring with each page request? Currently, each page
request separately opens the db, performs some action with it, then
closes the db. I would prefer to have it so that the first page access
opens the pstore db, which then stays around for use by subsequent
page requests.

Unfortunately, I'm still a bit confused as to the extent to which
information may be shared across requests. As I understand it,
mod_ruby (or apache) actually runs a pool of ruby interpreters each of
which has its own separate environment. A given request might end up
hitting any one of these. Is there away to have a single db
connection shared by all these ruby interpreters or must each one have
its own separate connection?

Thanks for any assistance you can offer.

Bruce
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top