This happened just a few minutes ago while accessing the problems section.Warning: mysql_connect() [function.mysql-connect]: User project_euler_2 already has more than 'max_user_connections' active connections in /mounted-storage/home15b/sub001/sc17392-BXBG/projecteuler.net/index.php on line 67
Could not connect to MySQL
projecteuler.net database problems
-
apnt
- Posts: 2
- Joined: Fri Dec 28, 2007 7:22 pm
- Location: 55 cm from the monitor
projecteuler.net database problems
Just as a heads up, you're maxing out your mysql database connections 
hey
- stijn263
- Posts: 1505
- Joined: Sat Sep 15, 2007 11:57 pm
- Location: Netherlands
- daniel.is.fischer
- Posts: 2400
- Joined: Sun Sep 02, 2007 11:15 pm
- Location: Bremen, Germany
Re: projecteuler.net database problems
Commiserations. Anybody got an idea how to circumvent that in the future? We already migrated to a different SQL-server.
Il faut respecter la montagne -- c'est pourquoi les gypaètes sont là.
- stijn263
- Posts: 1505
- Joined: Sat Sep 15, 2007 11:57 pm
- Location: Netherlands
Re: projecteuler.net database problems
don't know wether a larger and faster server would solve it, but should money be the problem, i suggest placing a "Donate to Project Euler" link somewhere. i think a lot of users would love to be able give something back to PE (well, i know i would, and i hope i'm not overgeneralizing
)
until then, i'll just keep spamming you with problem suggestions
until then, i'll just keep spamming you with problem suggestions
Last edited by daniel.is.fischer on Sun Jan 06, 2008 11:41 am, edited 1 time in total.
Reason: Fix typo
Reason: Fix typo
- daniel.is.fischer
- Posts: 2400
- Joined: Sun Sep 02, 2007 11:15 pm
- Location: Bremen, Germany
Re: projecteuler.net database problems
Cool, every other PE user giving a quid a month, we could even get paidhenk263 wrote:don't know wether a larger and faster server would solve it, but should money be the problem, i suggest placing a "Donate to Project Euler" link somewhere. i think a lot of users would love to be able give something back to PE (well, i know i would, and i hope i'm not overgeneralizing)
By all means, do.until then, i'll just keep spamming you with problem suggestions
Last edited by daniel.is.fischer on Sun Jan 06, 2008 11:41 am, edited 1 time in total.
Reason: Fix typo
Reason: Fix typo
Il faut respecter la montagne -- c'est pourquoi les gypaètes sont là.
-
apnt
- Posts: 2
- Joined: Fri Dec 28, 2007 7:22 pm
- Location: 55 cm from the monitor
Re: projecteuler.net database problems
Here's some ideas in no particular order.daniel.is.fischer wrote:Commiserations. Anybody got an idea how to circumvent that in the future? We already migrated to a different SQL-server.
1. Experiment switching between the mysql_connect and mysql_pconnect functions. Persistent connections will be better in some cases.
2. Increase the 'max_user_connections' value in your my.cnf file, if you have control over your database server.
3. Get a better-- more ram/faster processor/faster disk access database server
4. Add a database slave server or an array of database servers.
hey
-
Zell
- Posts: 4
- Joined: Sun Dec 23, 2007 6:26 pm
Re: projecteuler.net database problems
I see this is still happening. Might you be using persistent connections for some of your queries? Or do you perhaps open connections to several different databases in one session? I believe that confuses PHP's connection reuse mechanism. Try examining phpinfo() -- it should show active persistent connections. Do you have any idea how many DB connections your host allows? I assume you're in a shared environment.
- euler
- Administrator
- Posts: 5094
- Joined: Sun Mar 05, 2006 4:49 pm
- Location: Cheshire, England
- Contact:
Re: projecteuler.net database problems
The problem with using persistent connections is that if the script fails during a transaction then that particular connection will be blocked indefinitely for other users. Cumulatively this would eventually require a server restart. However, that's all academic as the hosts have the mysql.allow_persistent flag set to off. Interestingly they have the mysql.max_links flag set to unlimited (I'm not sure if this is different to the max_user_connections flag). Also I am unaware if this has been set recently in light of my continued contact with them. Please let me know if anyone else receives a "max_user_connections" error.

impudens simia et macrologus profundus fabulae
- ed_r
- Posts: 1009
- Joined: Sun Jul 29, 2007 10:57 am
Re: projecteuler.net database problems
Me too, roughly one minute ago:
(OK, I made up that last line; but the rest is verbatim from the server.)
Code: Select all
Warning: mysql_connect() [function.mysql-connect]: User project_euler_1 already has more than 'max_user_connections' active connections in /mounted-storage/home81c/sub002/sc17392-BXBG/projecteuler.net/rss_display.php on line 24
Could not connect to MySQL
Perhaps you should stop geeking around on PE and get some sleep?!647 = &8FDF4C
- elendiastarman
- Posts: 410
- Joined: Sat Dec 22, 2007 8:15 pm
Re: projecteuler.net database problems
I've had that error a few times yesterday as well...
Want some
3.14159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679...?

3.14159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679...?

- euler
- Administrator
- Posts: 5094
- Joined: Sun Mar 05, 2006 4:49 pm
- Location: Cheshire, England
- Contact:
Re: projecteuler.net database problems
I've discovered subsequently that max_user_connections is set to 20, so this would explain the problems we've been having; especially as we have been having between 50 and 100 people online during the busiest times of the day. I suspect that after the Christmas holidays the numbers will decline slightly.

impudens simia et macrologus profundus fabulae
-
cfox
- Posts: 1
- Joined: Thu Jan 03, 2008 6:23 pm
Re: projecteuler.net database problems
FWIW, I also came here looking for a paypal link, when the website problems became apparent; it sure sounds like your sysadmin could use a beer and nachos fund. I spent much of my Christmas visit to my in-law's working on problems and it kept me sane (or at least busy and happy).
It's great that you provide an RSS feed, but I'd like it even more if it provided the full text of the problem, when the problem is actually posted (rather than just a title, a few days beforehand). (This would probably neither hurt nor help the bandwidth problem.)
It's great that you provide an RSS feed, but I'd like it even more if it provided the full text of the problem, when the problem is actually posted (rather than just a title, a few days beforehand). (This would probably neither hurt nor help the bandwidth problem.)
-
otakucode
- Posts: 2
- Joined: Thu Jan 03, 2008 8:50 pm
Re: projecteuler.net database problems
I would gladly donate. I get the max users error very frequently and am finding it significantly difficult to submit answers. I'll get max user errors and then once it finally gets through I'll get an error saying I attempted to submit an answer before the exclusion period was over (whatever the hell that is, I'm guessing its a measure to stop people from trying to spam the server, but it is misfiring in my case) and it'll say that the exclusion period has then been extended to 30 minutes.
As for suggestions... how about swapping the servers running the forums and the ones running the problems and providing links from the problems to threads on these forums rather than having the comments be part of the problem/answer server. I'm guessing that the comments have to be 99.999% of the load on that server.
As for suggestions... how about swapping the servers running the forums and the ones running the problems and providing links from the problems to threads on these forums rather than having the comments be part of the problem/answer server. I'm guessing that the comments have to be 99.999% of the load on that server.
- daniel.is.fischer
- Posts: 2400
- Joined: Sun Sep 02, 2007 11:15 pm
- Location: Bremen, Germany
Re: projecteuler.net database problems
Less. The threads will create a lot of traffic, but currently over 2000 correct answers are submitted every day, no idea how many wrong ones, that's quite some traffic, too.
Correct, the exclusion period is a measure against spamming, anybody trying to submit more than three answers within one minute is then barred for 10 minutes, any attempt during these 10 minutes to submit an answer extends the exclusion period by another ten minutes. We are aware that it is most inconvenient for those who solve a bunch of problems offline and then want to submit the whole lot, but it probably is the lesser evil.
Correct, the exclusion period is a measure against spamming, anybody trying to submit more than three answers within one minute is then barred for 10 minutes, any attempt during these 10 minutes to submit an answer extends the exclusion period by another ten minutes. We are aware that it is most inconvenient for those who solve a bunch of problems offline and then want to submit the whole lot, but it probably is the lesser evil.
Il faut respecter la montagne -- c'est pourquoi les gypaètes sont là.
- euler
- Administrator
- Posts: 5094
- Joined: Sun Mar 05, 2006 4:49 pm
- Location: Cheshire, England
- Contact:
Re: projecteuler.net database problems
I've already done that. I did this between Christmas and New Year to help reduce server load! At the same time I temporarily removed the Forum page, showing the threads, number of posts, and "last post by", restricting access to the thread by clicking the green tick on the Problems page table or the link at the end of each problem description - assuming you've solved it. To help I think I'll revert back to this extreme measure to see if it helps in any way at all...otakucode wrote:As for suggestions... how about swapping the servers running the forums and the ones running the problems and providing links from the problems to threads on these forums rather than having the comments be part of the problem/answer server. I'm guessing that the comments have to be 99.999% of the load on that server.

impudens simia et macrologus profundus fabulae
- stijn263
- Posts: 1505
- Joined: Sat Sep 15, 2007 11:57 pm
- Location: Netherlands
Re: projecteuler.net database problems
i'm unable to login at the moment 
Login was unsuccessful. Please check your details carefully.
Login was unsuccessful. Please check your details carefully.
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /mounted-storage/home81c/sub002/sc17392-BXBG/projecteuler.net/index.php on line 74
Warning: Cannot modify header information - headers already sent by (output started at /mounted-storage/home81c/sub002/sc17392-BXBG/projecteuler.net/index.php:74) in /mounted-storage/home81c/sub002/sc17392-BXBG/projecteuler.net/index.php on line 161
Warning: Cannot modify header information - headers already sent by (output started at /mounted-storage/home81c/sub002/sc17392-BXBG/projecteuler.net/index.php:74) in /mounted-storage/home81c/sub002/sc17392-BXBG/projecteuler.net/index.php on line 162
Warning: Cannot modify header information - headers already sent by (output started at /mounted-storage/home81c/sub002/sc17392-BXBG/projecteuler.net/index.php:74) in /mounted-storage/home81c/sub002/sc17392-BXBG/projecteuler.net/index.php on line 163
- elendiastarman
- Posts: 410
- Joined: Sat Dec 22, 2007 8:15 pm
Re: projecteuler.net database problems
same here
also, accessing the problems page simply shows even more errors and no problems
*checks to copy & paste*
wow, that was fast
also, accessing the problems page simply shows even more errors and no problems
*checks to copy & paste*
wow, that was fast
Want some
3.14159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679...?

3.14159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679...?

-
BjornEdstrom
- Posts: 37
- Joined: Thu Nov 08, 2007 11:16 pm
Re: projecteuler.net database problems
For web apps, I'm a huge fan of the hybrid approach of using both static files and databases at the same time. The idea is to use the database as a backend and re-generate static pages from the data in the database when the database is updated. For example, instead of users accessing
http://projecteuler.net/index.php?secti ... ems&id=176
To view the latest problem, the system will generate a static html file at publication, say
http://projecteuler.net/problems/176.html
Whenever a user submits a correct solution, the system will re-generate the ranking list. And when a user posts something in the forum, the static thread html will be regenerated.
The database only needs to be accessed when the users submits something. Using this "hybrid" approach, it is usually possible, without too many modifications to the code, to reduce the database access to zero for browsing, and only tax the database when something "active" is happening.
In either case, I hope this works out. Anything I can do to help?
http://projecteuler.net/index.php?secti ... ems&id=176
To view the latest problem, the system will generate a static html file at publication, say
http://projecteuler.net/problems/176.html
Whenever a user submits a correct solution, the system will re-generate the ranking list. And when a user posts something in the forum, the static thread html will be regenerated.
The database only needs to be accessed when the users submits something. Using this "hybrid" approach, it is usually possible, without too many modifications to the code, to reduce the database access to zero for browsing, and only tax the database when something "active" is happening.
In either case, I hope this works out. Anything I can do to help?
- euler
- Administrator
- Posts: 5094
- Joined: Sun Mar 05, 2006 4:49 pm
- Location: Cheshire, England
- Contact:
Re: projecteuler.net database problems
Thanks!
Actually I am working away feverishly at the moment to do something like that on my local machine. I've managed to modify the scripts to handle semi-static versions of the Problems pages, but due to the highly dynamic nature of Project Euler I've had to make serious changes elsewhere. For example, the Scores page has been changed to a Top 100 table; previously it was necessary to identify the current user's position out of the number of active users and highlight their position in the table: not possible with a static page. As you suggested I've made the problem details into static html pages.
My current plan is to update the pages every hour via cronjobs.
The forum is going to require much more thought on the best way to handle and has been the main culprit in hogging server bandwidth.
I've been working on this for the past six hours and I am in serious need of bed...
Actually I am working away feverishly at the moment to do something like that on my local machine. I've managed to modify the scripts to handle semi-static versions of the Problems pages, but due to the highly dynamic nature of Project Euler I've had to make serious changes elsewhere. For example, the Scores page has been changed to a Top 100 table; previously it was necessary to identify the current user's position out of the number of active users and highlight their position in the table: not possible with a static page. As you suggested I've made the problem details into static html pages.
My current plan is to update the pages every hour via cronjobs.
The forum is going to require much more thought on the best way to handle and has been the main culprit in hogging server bandwidth.
I've been working on this for the past six hours and I am in serious need of bed...

impudens simia et macrologus profundus fabulae
-
kotulek
- Posts: 5
- Joined: Sat Dec 29, 2007 6:13 pm
- Location: Zeist, the Netherlands
Re: projecteuler.net database problems
I'm happy to see that PE is back again. Thank you very much euler for your hard work 
Last edited by kotulek on Sun Jan 06, 2008 8:38 am, edited 1 time in total.