Forum archive 2000-2006

Blake Thornton - Server Problems (How many students are you serving?)

Blake Thornton - Server Problems (How many students are you serving?)

by Arnold Pizer -
Number of replies: 0
inactiveTopicServer Problems (How many students are you serving?) topic started 10/11/2005; 3:48:22 PM
last post 10/18/2005; 8:42:32 PM
userBlake Thornton - Server Problems (How many students are you serving?)  blueArrow
10/11/2005; 3:48:22 PM (reads: 595, responses: 4)
We are having some server issues when running webwork that are frustrating our students. All of these problems clear up when the server is rebooted (so we have started rebooting nightly).

The error of the day was the "too many connections to database open". I believe this has been fixed---am I correct?

We are currently serving about 850 students on our one server. I believe that at most about 450 students have homework due on one day (yesterday we have 550 homework sets due so perhaps that helped give the "too many open connections error"). We are running

dual processor 2.4 GHz 1 G memory linux redhat enterprise advanaced server 3.0

Any thoughts would be helpful, Blake

<| Post or View Comments |>


userMichael Gage - Re: Server Problems (How many students are you serving?)  blueArrow
10/11/2005; 4:18:19 PM (reads: 711, responses: 0)
Just to be sure -- are you using the sql_single mode when setting up the courses? This uses fewer database connections than the original sql mode.

The other information we need is which version of WeBWorK you are running -- are you updated to WeBWorK 2.1.3 (the last tar ball at the beginning of the summer) to the current CVS?

-- Mike

<| Post or View Comments |>


userJohn Jones - Re: Server Problems (How many students are you serving?)  blueArrow
10/11/2005; 6:00:40 PM (reads: 702, responses: 0)
Hi,

There are a couple of things you can do to work around the connections limitation. First, as Mike said, using sql_single should make a big improvement over sql.

Next, the file /etc/my.cnf typically holds defaults for mysql. A line of

max_connections = 5000
will increase the number of connections allowed to 5000. This should be more than enough. If you do not have a my.cnf, copy something like /etc/my-small.cnf to /etc/my.cnf and then do the change.

After resetting this, restart mysql (I would run "/etc/rc.d/rc.mysqld restart" as root). Now you should never run out of mysql connections. Of course each mysqld process uses memory so this is not a cure all. Reducing max_connections for mysql does not result in connections being reused or anything like that. If you have an exhorbitant number of mysql connections, the problem is elsewhere and cannot be dealt with in /etc/my.cnf.

If you want to keep reducing the number of mysql connections, you can reduced the number of apache children which are running (httpd.conf). Each apache child produces a certain number of mysql connections.

Finally, you can try to reduce the number of mysql connections per apache process. Using sql_single is the biggest gain you can make here. In addition, you can also make usernameRO the same user as usernameRW (with corresponding password) in webwork2/conf/database.conf. This change typically cuts the number of mysql processes by 1/3, and should not have a performance cost.

John

<| Post or View Comments |>


userBlake Thornton - Re: Server Problems (How many students are you serving?)  blueArrow
10/11/2005; 9:46:46 PM (reads: 709, responses: 1)
Thanks for the responses and I will make some of the changes suggested and see if they make a difference.

We are currently running webwork version 2.0.1, so I don't think the sql_single_mode is an option right now. No upgrade for fear of breaking something or losing some data--it seems somewhat scary in the middle of the semester, but it is definitely on our list come December.

Doing a brief search makes me think that webwork should run quite well for our 850 students on our one server. Now I just have to make the modifications and upgrade as soon as possible.

Blake

<| Post or View Comments |>


userJun Wang - Re: Server Problems (How many students are you serving?)  blueArrow
10/18/2005; 8:42:32 PM (reads: 806, responses: 0)
We suddenly are having the same problem since last weekend (August 16th). Our server had been running without any problems since last January. This Fall semester, we added 4 more classes with about 160 students to our system. But the system did not have any problems until now, with a half of the semester passed and some students dropped out (there are fewer users now). We also will try John's fix and do the upgrading in December.

Jun

<| Post or View Comments |>