Mysql server high trafic makes websites really slow or unable to loadConcurrent MySQL requests are really...

Should I choose Itemized or Standard deduction?

How would we write a misogynistic character without offending people?

Use comma instead of & in table

How to properly claim credit for peer review?

Second-rate spelling

Hacker Rank: Array left rotation

Is there a German word for “analytics”?

Logistics of a hovering watercraft in a fantasy setting

Is divide-by-zero a security vulnerability?

I can't die. Who am I?

What is this waxed root vegetable?

Why is working on the same position for more than 15 years not a red flag?

Did Amazon pay $0 in taxes last year?

Linear regression when Y is bounded and discrete

How do I construct an nxn matrix?

Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?

I am on the US no-fly list. What can I do in order to be allowed on flights which go through US airspace?

What to do when being responsible for data protection in your lab, yet advice is ignored?

Where is this triangular-shaped space station from?

What are these green text/line displays shown during the livestream of Crew Dragon's approach to dock with the ISS?

Why does Starman/Roadster have radial acceleration?

Is there a frame of reference in which I was born before I was conceived?

How do ISS astronauts "get their stripes"?

How can atoms be electrically neutral when there is a difference in the positions of the charges?



Mysql server high trafic makes websites really slow or unable to load


Concurrent MySQL requests are really slow on OS XIntermittent blocking mysql queryHigh load and iowait on MySQL database server leads to slow MySQL INSERTSHigh server load after upgrading to MySql5.5MySQL high cpu load slow quries being logged need help to understandMySQL high CPU usage on small websiteHigh CPU on MySql Fusion-io serverVery High CPU load Low to Medium RAM usage on VPS (mysql over 100% CPU)MySQL connections disconnection causing high CPUHigh traffic MYSQL server













1















Lately we have been having a lot of problems with our mysql server, from websites being really slow or even unable to load them at all. The server is a dedicated server that only runs our mysql database. i have been running some test using a profiler (JetProfiler) and tool to stress test (loadUI).



If I use loadUI to connect with 50 simultaneous connections to one of our websites that runs a resently big query it will already make the website be unable to load. One of the things that makes me worried is that when I look at Jetprofile it always shows a Treads_connected of 1.00 and it seems that when it hits around 2.00 that I'm unable to connect.



enter image description here



The 3 big peaks are when I run a test with loadUI, first one was 15 simultaneous connections wich made it still able for me to load the website but just really slow, the second one was 40 simultaneous connections which already made it impossible to load and the third one was with 100 connection which also didn't make it load anymore.



Another thing that worries me is that in JetProfiler it says all the queries that get used are full table scans, could this maybe be the problem? The website I run as a test runs 3 queries, one for a menu that outputs around 1000 rows, one for the adds that has around 560 rows and a big one to get posts that has around 7000 rows (see screenshot bellow)



enter image description here



I also have monitored the cpu of the server and there seems to be no problem there, even when I make a lot of connections with loadui the cpu stays low.



I can't seem to figure out what is the main cause of the websites being unable to load when there is a high amount of traffic, if anyone has other suggestions for testing or something that might cause the problem please let me know.










share|improve this question
















bumped to the homepage by Community 4 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • How many cores does your server have? If you are consuming more than one core, and you are on a virtual server that is only given one core, then multiple threads will not provide increase performance.

    – Myrddin Emrys
    Apr 4 '12 at 8:26











  • Server has 2 cores

    – Holapress
    Apr 4 '12 at 8:30











  • How does your database schema look? Do you use indexes?

    – Tim
    Apr 4 '12 at 8:36











  • Every table has a primary index and thats it

    – Holapress
    Apr 4 '12 at 8:39











  • I started to comment that lack of indexes can be a serious issue (and it can), but that would also spike your CPU. You have indicated your utilization remains low. However, can you clarify your statement about 'menu that outputs 1000 rows'. Do you mean that every page request returns 1000 results for the menu query? This seems excessive... I would expect 10 results, not 1000. Same for the other interactions. Your bottleneck may be throughput (bandwidth).

    – Myrddin Emrys
    Apr 4 '12 at 8:47
















1















Lately we have been having a lot of problems with our mysql server, from websites being really slow or even unable to load them at all. The server is a dedicated server that only runs our mysql database. i have been running some test using a profiler (JetProfiler) and tool to stress test (loadUI).



If I use loadUI to connect with 50 simultaneous connections to one of our websites that runs a resently big query it will already make the website be unable to load. One of the things that makes me worried is that when I look at Jetprofile it always shows a Treads_connected of 1.00 and it seems that when it hits around 2.00 that I'm unable to connect.



enter image description here



The 3 big peaks are when I run a test with loadUI, first one was 15 simultaneous connections wich made it still able for me to load the website but just really slow, the second one was 40 simultaneous connections which already made it impossible to load and the third one was with 100 connection which also didn't make it load anymore.



Another thing that worries me is that in JetProfiler it says all the queries that get used are full table scans, could this maybe be the problem? The website I run as a test runs 3 queries, one for a menu that outputs around 1000 rows, one for the adds that has around 560 rows and a big one to get posts that has around 7000 rows (see screenshot bellow)



enter image description here



I also have monitored the cpu of the server and there seems to be no problem there, even when I make a lot of connections with loadui the cpu stays low.



I can't seem to figure out what is the main cause of the websites being unable to load when there is a high amount of traffic, if anyone has other suggestions for testing or something that might cause the problem please let me know.










share|improve this question
















bumped to the homepage by Community 4 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • How many cores does your server have? If you are consuming more than one core, and you are on a virtual server that is only given one core, then multiple threads will not provide increase performance.

    – Myrddin Emrys
    Apr 4 '12 at 8:26











  • Server has 2 cores

    – Holapress
    Apr 4 '12 at 8:30











  • How does your database schema look? Do you use indexes?

    – Tim
    Apr 4 '12 at 8:36











  • Every table has a primary index and thats it

    – Holapress
    Apr 4 '12 at 8:39











  • I started to comment that lack of indexes can be a serious issue (and it can), but that would also spike your CPU. You have indicated your utilization remains low. However, can you clarify your statement about 'menu that outputs 1000 rows'. Do you mean that every page request returns 1000 results for the menu query? This seems excessive... I would expect 10 results, not 1000. Same for the other interactions. Your bottleneck may be throughput (bandwidth).

    – Myrddin Emrys
    Apr 4 '12 at 8:47














1












1








1








Lately we have been having a lot of problems with our mysql server, from websites being really slow or even unable to load them at all. The server is a dedicated server that only runs our mysql database. i have been running some test using a profiler (JetProfiler) and tool to stress test (loadUI).



If I use loadUI to connect with 50 simultaneous connections to one of our websites that runs a resently big query it will already make the website be unable to load. One of the things that makes me worried is that when I look at Jetprofile it always shows a Treads_connected of 1.00 and it seems that when it hits around 2.00 that I'm unable to connect.



enter image description here



The 3 big peaks are when I run a test with loadUI, first one was 15 simultaneous connections wich made it still able for me to load the website but just really slow, the second one was 40 simultaneous connections which already made it impossible to load and the third one was with 100 connection which also didn't make it load anymore.



Another thing that worries me is that in JetProfiler it says all the queries that get used are full table scans, could this maybe be the problem? The website I run as a test runs 3 queries, one for a menu that outputs around 1000 rows, one for the adds that has around 560 rows and a big one to get posts that has around 7000 rows (see screenshot bellow)



enter image description here



I also have monitored the cpu of the server and there seems to be no problem there, even when I make a lot of connections with loadui the cpu stays low.



I can't seem to figure out what is the main cause of the websites being unable to load when there is a high amount of traffic, if anyone has other suggestions for testing or something that might cause the problem please let me know.










share|improve this question
















Lately we have been having a lot of problems with our mysql server, from websites being really slow or even unable to load them at all. The server is a dedicated server that only runs our mysql database. i have been running some test using a profiler (JetProfiler) and tool to stress test (loadUI).



If I use loadUI to connect with 50 simultaneous connections to one of our websites that runs a resently big query it will already make the website be unable to load. One of the things that makes me worried is that when I look at Jetprofile it always shows a Treads_connected of 1.00 and it seems that when it hits around 2.00 that I'm unable to connect.



enter image description here



The 3 big peaks are when I run a test with loadUI, first one was 15 simultaneous connections wich made it still able for me to load the website but just really slow, the second one was 40 simultaneous connections which already made it impossible to load and the third one was with 100 connection which also didn't make it load anymore.



Another thing that worries me is that in JetProfiler it says all the queries that get used are full table scans, could this maybe be the problem? The website I run as a test runs 3 queries, one for a menu that outputs around 1000 rows, one for the adds that has around 560 rows and a big one to get posts that has around 7000 rows (see screenshot bellow)



enter image description here



I also have monitored the cpu of the server and there seems to be no problem there, even when I make a lot of connections with loadui the cpu stays low.



I can't seem to figure out what is the main cause of the websites being unable to load when there is a high amount of traffic, if anyone has other suggestions for testing or something that might cause the problem please let me know.







mysql sql-server query






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 4 '12 at 8:26









Lucas Kauffman

15.6k64885




15.6k64885










asked Apr 4 '12 at 8:20









HolapressHolapress

62




62





bumped to the homepage by Community 4 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 4 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • How many cores does your server have? If you are consuming more than one core, and you are on a virtual server that is only given one core, then multiple threads will not provide increase performance.

    – Myrddin Emrys
    Apr 4 '12 at 8:26











  • Server has 2 cores

    – Holapress
    Apr 4 '12 at 8:30











  • How does your database schema look? Do you use indexes?

    – Tim
    Apr 4 '12 at 8:36











  • Every table has a primary index and thats it

    – Holapress
    Apr 4 '12 at 8:39











  • I started to comment that lack of indexes can be a serious issue (and it can), but that would also spike your CPU. You have indicated your utilization remains low. However, can you clarify your statement about 'menu that outputs 1000 rows'. Do you mean that every page request returns 1000 results for the menu query? This seems excessive... I would expect 10 results, not 1000. Same for the other interactions. Your bottleneck may be throughput (bandwidth).

    – Myrddin Emrys
    Apr 4 '12 at 8:47



















  • How many cores does your server have? If you are consuming more than one core, and you are on a virtual server that is only given one core, then multiple threads will not provide increase performance.

    – Myrddin Emrys
    Apr 4 '12 at 8:26











  • Server has 2 cores

    – Holapress
    Apr 4 '12 at 8:30











  • How does your database schema look? Do you use indexes?

    – Tim
    Apr 4 '12 at 8:36











  • Every table has a primary index and thats it

    – Holapress
    Apr 4 '12 at 8:39











  • I started to comment that lack of indexes can be a serious issue (and it can), but that would also spike your CPU. You have indicated your utilization remains low. However, can you clarify your statement about 'menu that outputs 1000 rows'. Do you mean that every page request returns 1000 results for the menu query? This seems excessive... I would expect 10 results, not 1000. Same for the other interactions. Your bottleneck may be throughput (bandwidth).

    – Myrddin Emrys
    Apr 4 '12 at 8:47

















How many cores does your server have? If you are consuming more than one core, and you are on a virtual server that is only given one core, then multiple threads will not provide increase performance.

– Myrddin Emrys
Apr 4 '12 at 8:26





How many cores does your server have? If you are consuming more than one core, and you are on a virtual server that is only given one core, then multiple threads will not provide increase performance.

– Myrddin Emrys
Apr 4 '12 at 8:26













Server has 2 cores

– Holapress
Apr 4 '12 at 8:30





Server has 2 cores

– Holapress
Apr 4 '12 at 8:30













How does your database schema look? Do you use indexes?

– Tim
Apr 4 '12 at 8:36





How does your database schema look? Do you use indexes?

– Tim
Apr 4 '12 at 8:36













Every table has a primary index and thats it

– Holapress
Apr 4 '12 at 8:39





Every table has a primary index and thats it

– Holapress
Apr 4 '12 at 8:39













I started to comment that lack of indexes can be a serious issue (and it can), but that would also spike your CPU. You have indicated your utilization remains low. However, can you clarify your statement about 'menu that outputs 1000 rows'. Do you mean that every page request returns 1000 results for the menu query? This seems excessive... I would expect 10 results, not 1000. Same for the other interactions. Your bottleneck may be throughput (bandwidth).

– Myrddin Emrys
Apr 4 '12 at 8:47





I started to comment that lack of indexes can be a serious issue (and it can), but that would also spike your CPU. You have indicated your utilization remains low. However, can you clarify your statement about 'menu that outputs 1000 rows'. Do you mean that every page request returns 1000 results for the menu query? This seems excessive... I would expect 10 results, not 1000. Same for the other interactions. Your bottleneck may be throughput (bandwidth).

– Myrddin Emrys
Apr 4 '12 at 8:47










2 Answers
2






active

oldest

votes


















0














Some nice pictures, but there's a lot of info missing from your post.



What's the max connections? How big is the database? What engine? What's the key buffer size? How much free memory does the DBMS have?




full table scans, could this maybe be the problem?




Could be - not enough information to say. If the query needs to read more than approx a tenth of the data, the a full table scan will be faster than an index lookup.




queries, one for a menu that outputs around 1000 rows




You have menus on your web pages with 1000 entries? Then most of your problems are not in the database. Your application is fetching FAR TOO MUCH DATA from the database. If it's then sending this information across internet then performance will be appalling. If it's not sending out all the data it's fetching then why aren't you doing the filtering on the DBMS.




Every table has a primary index and thats it




Maybe you should think about aligning your schema with your queries (i.e. add relevant indexes) however think the biggest problem you've got is that you're fetching data from the DBMS which just isn't getting used.



OTOH do you mean that when you analyse the queries using the same tool as in your screenshot it tells you it's processing thousands of rows? In that case fixing the indexing will have a huge impact.






share|improve this answer































    0














    With a slow down occurring when the number of simultaneous connections increases this could be a connection pooling issue. If the server/connection pool is set to only allow a set number of connections (say 5) then later connections will be queued up till there is space in the queue. Also if a single page hit leads to various SQL queries being fired, but each one opens a brand new connection to MySQL (rather than re-using an earlier connection) then this can lead to masses of connection requests being generated.



    How you control connection pooling is implementation specific (different languages/libraries do it in different ways) and there is a sweet spot as far as how many connections to the database are kept open. With systems such as Tomcat, Tomcat itself can be set to open connections to the database when it is started and have these available for applications/servlets as and when they are needed. You'd have to profile your app and usage to see what a sensible sweet spot is (as holding open unnecessary connections uses memory).



    Otherwise, most scripting languages used for web stuff (as an example) have database libraries that open a connection at the start of the page and then you just reuse that reference for the rest of the page. Worth checking whether this is happening (though you may not have massive control over the code).



    I'm basing this off timing issues I've had at work with connection pooling between a Tomcat web app and a proprietary database system. It may not be relevant.






    share|improve this answer
























    • yea im using php, it opens the conection at the start of the page.

      – Holapress
      Apr 5 '12 at 9:33











    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "2"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f376561%2fmysql-server-high-trafic-makes-websites-really-slow-or-unable-to-load%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Some nice pictures, but there's a lot of info missing from your post.



    What's the max connections? How big is the database? What engine? What's the key buffer size? How much free memory does the DBMS have?




    full table scans, could this maybe be the problem?




    Could be - not enough information to say. If the query needs to read more than approx a tenth of the data, the a full table scan will be faster than an index lookup.




    queries, one for a menu that outputs around 1000 rows




    You have menus on your web pages with 1000 entries? Then most of your problems are not in the database. Your application is fetching FAR TOO MUCH DATA from the database. If it's then sending this information across internet then performance will be appalling. If it's not sending out all the data it's fetching then why aren't you doing the filtering on the DBMS.




    Every table has a primary index and thats it




    Maybe you should think about aligning your schema with your queries (i.e. add relevant indexes) however think the biggest problem you've got is that you're fetching data from the DBMS which just isn't getting used.



    OTOH do you mean that when you analyse the queries using the same tool as in your screenshot it tells you it's processing thousands of rows? In that case fixing the indexing will have a huge impact.






    share|improve this answer




























      0














      Some nice pictures, but there's a lot of info missing from your post.



      What's the max connections? How big is the database? What engine? What's the key buffer size? How much free memory does the DBMS have?




      full table scans, could this maybe be the problem?




      Could be - not enough information to say. If the query needs to read more than approx a tenth of the data, the a full table scan will be faster than an index lookup.




      queries, one for a menu that outputs around 1000 rows




      You have menus on your web pages with 1000 entries? Then most of your problems are not in the database. Your application is fetching FAR TOO MUCH DATA from the database. If it's then sending this information across internet then performance will be appalling. If it's not sending out all the data it's fetching then why aren't you doing the filtering on the DBMS.




      Every table has a primary index and thats it




      Maybe you should think about aligning your schema with your queries (i.e. add relevant indexes) however think the biggest problem you've got is that you're fetching data from the DBMS which just isn't getting used.



      OTOH do you mean that when you analyse the queries using the same tool as in your screenshot it tells you it's processing thousands of rows? In that case fixing the indexing will have a huge impact.






      share|improve this answer


























        0












        0








        0







        Some nice pictures, but there's a lot of info missing from your post.



        What's the max connections? How big is the database? What engine? What's the key buffer size? How much free memory does the DBMS have?




        full table scans, could this maybe be the problem?




        Could be - not enough information to say. If the query needs to read more than approx a tenth of the data, the a full table scan will be faster than an index lookup.




        queries, one for a menu that outputs around 1000 rows




        You have menus on your web pages with 1000 entries? Then most of your problems are not in the database. Your application is fetching FAR TOO MUCH DATA from the database. If it's then sending this information across internet then performance will be appalling. If it's not sending out all the data it's fetching then why aren't you doing the filtering on the DBMS.




        Every table has a primary index and thats it




        Maybe you should think about aligning your schema with your queries (i.e. add relevant indexes) however think the biggest problem you've got is that you're fetching data from the DBMS which just isn't getting used.



        OTOH do you mean that when you analyse the queries using the same tool as in your screenshot it tells you it's processing thousands of rows? In that case fixing the indexing will have a huge impact.






        share|improve this answer













        Some nice pictures, but there's a lot of info missing from your post.



        What's the max connections? How big is the database? What engine? What's the key buffer size? How much free memory does the DBMS have?




        full table scans, could this maybe be the problem?




        Could be - not enough information to say. If the query needs to read more than approx a tenth of the data, the a full table scan will be faster than an index lookup.




        queries, one for a menu that outputs around 1000 rows




        You have menus on your web pages with 1000 entries? Then most of your problems are not in the database. Your application is fetching FAR TOO MUCH DATA from the database. If it's then sending this information across internet then performance will be appalling. If it's not sending out all the data it's fetching then why aren't you doing the filtering on the DBMS.




        Every table has a primary index and thats it




        Maybe you should think about aligning your schema with your queries (i.e. add relevant indexes) however think the biggest problem you've got is that you're fetching data from the DBMS which just isn't getting used.



        OTOH do you mean that when you analyse the queries using the same tool as in your screenshot it tells you it's processing thousands of rows? In that case fixing the indexing will have a huge impact.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 4 '12 at 11:06









        symcbeansymcbean

        18.7k12237




        18.7k12237

























            0














            With a slow down occurring when the number of simultaneous connections increases this could be a connection pooling issue. If the server/connection pool is set to only allow a set number of connections (say 5) then later connections will be queued up till there is space in the queue. Also if a single page hit leads to various SQL queries being fired, but each one opens a brand new connection to MySQL (rather than re-using an earlier connection) then this can lead to masses of connection requests being generated.



            How you control connection pooling is implementation specific (different languages/libraries do it in different ways) and there is a sweet spot as far as how many connections to the database are kept open. With systems such as Tomcat, Tomcat itself can be set to open connections to the database when it is started and have these available for applications/servlets as and when they are needed. You'd have to profile your app and usage to see what a sensible sweet spot is (as holding open unnecessary connections uses memory).



            Otherwise, most scripting languages used for web stuff (as an example) have database libraries that open a connection at the start of the page and then you just reuse that reference for the rest of the page. Worth checking whether this is happening (though you may not have massive control over the code).



            I'm basing this off timing issues I've had at work with connection pooling between a Tomcat web app and a proprietary database system. It may not be relevant.






            share|improve this answer
























            • yea im using php, it opens the conection at the start of the page.

              – Holapress
              Apr 5 '12 at 9:33
















            0














            With a slow down occurring when the number of simultaneous connections increases this could be a connection pooling issue. If the server/connection pool is set to only allow a set number of connections (say 5) then later connections will be queued up till there is space in the queue. Also if a single page hit leads to various SQL queries being fired, but each one opens a brand new connection to MySQL (rather than re-using an earlier connection) then this can lead to masses of connection requests being generated.



            How you control connection pooling is implementation specific (different languages/libraries do it in different ways) and there is a sweet spot as far as how many connections to the database are kept open. With systems such as Tomcat, Tomcat itself can be set to open connections to the database when it is started and have these available for applications/servlets as and when they are needed. You'd have to profile your app and usage to see what a sensible sweet spot is (as holding open unnecessary connections uses memory).



            Otherwise, most scripting languages used for web stuff (as an example) have database libraries that open a connection at the start of the page and then you just reuse that reference for the rest of the page. Worth checking whether this is happening (though you may not have massive control over the code).



            I'm basing this off timing issues I've had at work with connection pooling between a Tomcat web app and a proprietary database system. It may not be relevant.






            share|improve this answer
























            • yea im using php, it opens the conection at the start of the page.

              – Holapress
              Apr 5 '12 at 9:33














            0












            0








            0







            With a slow down occurring when the number of simultaneous connections increases this could be a connection pooling issue. If the server/connection pool is set to only allow a set number of connections (say 5) then later connections will be queued up till there is space in the queue. Also if a single page hit leads to various SQL queries being fired, but each one opens a brand new connection to MySQL (rather than re-using an earlier connection) then this can lead to masses of connection requests being generated.



            How you control connection pooling is implementation specific (different languages/libraries do it in different ways) and there is a sweet spot as far as how many connections to the database are kept open. With systems such as Tomcat, Tomcat itself can be set to open connections to the database when it is started and have these available for applications/servlets as and when they are needed. You'd have to profile your app and usage to see what a sensible sweet spot is (as holding open unnecessary connections uses memory).



            Otherwise, most scripting languages used for web stuff (as an example) have database libraries that open a connection at the start of the page and then you just reuse that reference for the rest of the page. Worth checking whether this is happening (though you may not have massive control over the code).



            I'm basing this off timing issues I've had at work with connection pooling between a Tomcat web app and a proprietary database system. It may not be relevant.






            share|improve this answer













            With a slow down occurring when the number of simultaneous connections increases this could be a connection pooling issue. If the server/connection pool is set to only allow a set number of connections (say 5) then later connections will be queued up till there is space in the queue. Also if a single page hit leads to various SQL queries being fired, but each one opens a brand new connection to MySQL (rather than re-using an earlier connection) then this can lead to masses of connection requests being generated.



            How you control connection pooling is implementation specific (different languages/libraries do it in different ways) and there is a sweet spot as far as how many connections to the database are kept open. With systems such as Tomcat, Tomcat itself can be set to open connections to the database when it is started and have these available for applications/servlets as and when they are needed. You'd have to profile your app and usage to see what a sensible sweet spot is (as holding open unnecessary connections uses memory).



            Otherwise, most scripting languages used for web stuff (as an example) have database libraries that open a connection at the start of the page and then you just reuse that reference for the rest of the page. Worth checking whether this is happening (though you may not have massive control over the code).



            I'm basing this off timing issues I've had at work with connection pooling between a Tomcat web app and a proprietary database system. It may not be relevant.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Apr 4 '12 at 11:07









            webtoewebtoe

            1,796811




            1,796811













            • yea im using php, it opens the conection at the start of the page.

              – Holapress
              Apr 5 '12 at 9:33



















            • yea im using php, it opens the conection at the start of the page.

              – Holapress
              Apr 5 '12 at 9:33

















            yea im using php, it opens the conection at the start of the page.

            – Holapress
            Apr 5 '12 at 9:33





            yea im using php, it opens the conection at the start of the page.

            – Holapress
            Apr 5 '12 at 9:33


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Server Fault!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f376561%2fmysql-server-high-trafic-makes-websites-really-slow-or-unable-to-load%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

            Список ссавців Італії Природоохоронні статуси | Список |...

            Українські прізвища Зміст Історичні відомості |...