I installed the lastest version of mod_auth_mysql, I still got the problem where too many mysql connections established. I thought KeepAlive is disable in version 3. Here are some of mySQL connections from just a few users. Sometimes, I got hundereds of users download stuffs from my website. I often face the problem of too many connections error. Even though I already set the maximum connection to the [download] directory to 5.
How do I make apache check for max connections before authenticate users using mod_auth_mysql?
But the most important thing is there a way to drop mysql connections after it's done with the authentication?
AuthMySQLKeepAlive is disabled - but that's not your problem. Your problem is that the downloads are taking too long.
Apache calls our module on the first request for a resource (i.e. web page). It keeps the page active until the last request for the page is complete. This is for efficiency - for instance, if you have a page with four graphics, there will be five requests from the Browser to Apache; one for the page itself and one for each graphic. The same is true for other non-SSI requests such as links to CSS and JavaScript files.
I can look into adding a parameter to terminate the connection immediately, but I'm afraid that's going to have a serious performance impact. It takes a significant amount of computer time to establish a connection to MySQl, and having to make and break multiple connections for one web page can cause serious performance issues.
Jerry
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't think there is a big impact on the performance on my system as all of the files user downloading from my website are about 100MB. Can you add the parameter to terminate the connection?
Thanks in advance Jerry.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I looked into the code today. It shouldn't be too hard, but I need to ensure I have all the bases covered. I don't want to spend too much time on it because the whole area is up for revamp - we want to go to connection pooling, but that also means using shared memory and semaphores - a lot more complicated. It's something we've been working on in our spare time, but it will take a while.
Meanwhile, if it isn't too bad and doesn't break anything else I should be able to get it in. I'll need a few days, though.
Jerry
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No, everything is working fine now because I already limit the maximum connections to 4. But if you get it done, I don't have to limit the maximum connection anymore. I do not have to delete the http-errors.log every now and then.
thanks Jerry.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just rent another dedicated server yesterday, the number of members is increasing, I am wondering if you can terminate the connection after they authenticated.
thanks in advance Jerry
tscbh
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Umm, I was thinking of donating if you get this done for me. But since you mentioned about paying, then could you please give me a price?
I don't think it too hard to terminate the connection after authenticated. I never working with C or Apache module before so there is nothing I can do.
Thanks Jerry,
tscbh
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the offer, but we don't accept donations for the project. We do it because we want to make it better.
Which does bring up a problem. It takes time to determine what changes need to be made, ensure those changes don't cause problems in other areas of the code, make the changes and test under different conditions. Taking someone off a paying project would mean several hundred dollars of lost revenue.
We can work on free projects such as mod_auth_mysql when we don't have paying jobs pending. It's a good use of our time and expands the open source community. But it also means one week we may have several hours available to work on it, but the next week we have none. Sorry, but that's how it works out.
Of course, the other option would be to just junk the free projects and play online games :-).
Jerry
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I installed the lastest version of mod_auth_mysql, I still got the problem where too many mysql connections established. I thought KeepAlive is disable in version 3. Here are some of mySQL connections from just a few users. Sometimes, I got hundereds of users download stuffs from my website. I often face the problem of too many connections error. Even though I already set the maximum connection to the [download] directory to 5.
How do I make apache check for max connections before authenticate users using mod_auth_mysql?
But the most important thing is there a way to drop mysql connections after it's done with the authentication?
Is there any suggestions?
tscbh
+---------+------+-----------+---------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+---------+------+-----------+---------+---------+------+-------+------------------+
| 1070635 | root | localhost | phimtap | Sleep | 1075 | | |
| 1070638 | root | localhost | phimtap | Sleep | 1075 | | |
| 1070646 | root | localhost | phimtap | Sleep | 1071 | | |
| 1070647 | root | localhost | phimtap | Sleep | 1071 | | |
| 1070648 | root | localhost | phimtap | Sleep | 1071 | | |
| 1070649 | root | localhost | phimtap | Sleep | 1071 | | |
| 1070650 | root | localhost | phimtap | Sleep | 1071 | | |
| 1070652 | root | localhost | phimtap | Sleep | 1071 | | |
| 1070671 | root | localhost | phimtap | Sleep | 1065 | | |
| 1070679 | root | localhost | phimtap | Sleep | 1062 | | |
| 1070691 | root | localhost | phimtap | Sleep | 1054 | | |
| 1070692 | root | localhost | phimtap | Sleep | 1054 | | |
| 1070693 | root | localhost | phimtap | Sleep | 1053 | | |
| 1070694 | root | localhost | phimtap | Sleep | 1053 | | |
| 1070695 | root | localhost | phimtap | Sleep | 1053 | | |
AuthMySQLKeepAlive is disabled - but that's not your problem. Your problem is that the downloads are taking too long.
Apache calls our module on the first request for a resource (i.e. web page). It keeps the page active until the last request for the page is complete. This is for efficiency - for instance, if you have a page with four graphics, there will be five requests from the Browser to Apache; one for the page itself and one for each graphic. The same is true for other non-SSI requests such as links to CSS and JavaScript files.
I can look into adding a parameter to terminate the connection immediately, but I'm afraid that's going to have a serious performance impact. It takes a significant amount of computer time to establish a connection to MySQl, and having to make and break multiple connections for one web page can cause serious performance issues.
Jerry
I don't think there is a big impact on the performance on my system as all of the files user downloading from my website are about 100MB. Can you add the parameter to terminate the connection?
Thanks in advance Jerry.
I looked into the code today. It shouldn't be too hard, but I need to ensure I have all the bases covered. I don't want to spend too much time on it because the whole area is up for revamp - we want to go to connection pooling, but that also means using shared memory and semaphores - a lot more complicated. It's something we've been working on in our spare time, but it will take a while.
Meanwhile, if it isn't too bad and doesn't break anything else I should be able to get it in. I'll need a few days, though.
Jerry
No, everything is working fine now because I already limit the maximum connections to 4. But if you get it done, I don't have to limit the maximum connection anymore. I do not have to delete the http-errors.log every now and then.
thanks Jerry.
Hi Jerry,
I just rent another dedicated server yesterday, the number of members is increasing, I am wondering if you can terminate the connection after they authenticated.
thanks in advance Jerry
tscbh
tscbh,
We're working on it as time permits. It does take time, and unfortuantely paying customers come first :-).
We'll get something out as soon as possible.
Jerry
Umm, I was thinking of donating if you get this done for me. But since you mentioned about paying, then could you please give me a price?
I don't think it too hard to terminate the connection after authenticated. I never working with C or Apache module before so there is nothing I can do.
Thanks Jerry,
tscbh
Thanks for the offer, but we don't accept donations for the project. We do it because we want to make it better.
Which does bring up a problem. It takes time to determine what changes need to be made, ensure those changes don't cause problems in other areas of the code, make the changes and test under different conditions. Taking someone off a paying project would mean several hundred dollars of lost revenue.
We can work on free projects such as mod_auth_mysql when we don't have paying jobs pending. It's a good use of our time and expands the open source community. But it also means one week we may have several hours available to work on it, but the next week we have none. Sorry, but that's how it works out.
Of course, the other option would be to just junk the free projects and play online games :-).
Jerry
Hi Jerry,
I solved the problem by creating a script that kill mysql process that's sleep for more than 100 seconds.
thanks for mod_auth_mysql