Page 1 of 1

[Solved]Error 503 One out of three

PostPosted: Fri Oct 19, 2012 3:08 am
by silma
Hello Steve, hello everyone,

I encounter an unexpected problem with a tiny app, and i'm stuck.


The app works well in WAMP on my machine.

When i put it online on a shared hosting server I change:
- the session path in the index.php => /tmp
- the database path

Here the trouble :
Two out of tree, the app works as expected
One out of three, it never load, and finish with a 503 error after 300 seconds.
The message is :
Error 503 Service Unavailable
Service Unavailable
Guru Meditation: XID: 1678726856
Varnish cache server


I asked my hosting services before posting here,and they told me i'm the only user with this kind of trouble at the moment.

It seems (but i'm not sure about it) that when i empty the /tmp directory OR/AND when the browser cache is empty, the error occurs less.

I use Xataface 1.3.2.

If you want to try you can see it happen (or not...)here.

Any idea would be welcome.
(Do not hesitate to ask for clarification ; i hope my english is not too incomprehensible)



Thanks a lot.

Re: Error 503 One out of three

PostPosted: Fri Oct 19, 2012 8:02 am
by shannah
Not sure what would cause this. I tried your link and then refreshed about 20 times. It seemed to load quickly each time.

Re: Error 503 One out of three

PostPosted: Fri Oct 19, 2012 9:00 am
by silma
You right, it seems to works now.
My hosting services must have done someting... I'll investigate before mark this one as solved.

Thanks for trying !

Re: Error 503 One out of three

PostPosted: Sat Oct 20, 2012 6:53 am
by silma
Hello again,

It was not my hosting services doing, and the error was back this morning.
I emptied the /tmp directory, and after a few minutes (5/10) everythings seems to works.

I was quite surprised by the way : i had 1500+ sessions stored, since yesterday ? (i already emptied it yesterday).
I can make something to empty the tmp directory on a regular basis , but i'm sure it's not the way it should works.

What can go wrong with my sessions ?

Thanks for the help.

Re: Error 503 One out of three

PostPosted: Sat Oct 20, 2012 8:44 am
by shannah
Xataface does start a session for all connections. If you haven't specified a long timeout these should be garbage collected every 20 minutes or so. In 2.0 I have added a setting to disable sessions until the user tries to log in... I'll have to refer to my notes to remember what setting that is and whether it has been back ported to 1.3.x

Steve

Re: Error 503 One out of three

PostPosted: Sat Oct 20, 2012 9:50 am
by silma
I could retrieve 2.0 for the svn, too.
I'll just need an hint on how to disable the sessions.
(Most of user will never log in)

Re: [Solved]Error 503 One out of three

PostPosted: Sun Oct 21, 2012 9:05 am
by silma
I finally resolved the mystery... and of course, it was my fault, and the framework as nothing to do with it :oops:

On this app, i had a "complex" view used as a tab, and it take too much time to generate, so it slow down the database, that slow down eveything else.

I still dont know why i have thousands of sessions file, but it must be related somehow.

Anyway, thanks a lot for your help, with all my apologies.

Re: [Solved]Error 503 One out of three

PostPosted: Fri Oct 26, 2012 8:02 am
by shannah
Just checked the source and in 2.0 sessions are not created until the user tries to log in - sessions can be turned on if the application requires it, but this solves the thousands of session files for the most part.

On 1.3.x it creates a session for every user whether logged in or not. This can build up a lot of session files, but if you keep the session timeout and session garbage collection settings to reasonable levels, it should keep these under wraps. This page has a good description of the garbage collection settings:
http://www.appnovation.com/session-garb ... ection-php

-Steve

Re: [Solved]Error 503 One out of three

PostPosted: Sun Oct 28, 2012 2:08 am
by silma
Thanks a lot Steve, i think i'll use this app to try the new 2.0.