AWS RDS connection limits The 2019 Stack Overflow Developer Survey Results Are InPoor performance on Amazon RDS instanceAWS - bigger EC2 instance or DB splitAWS RDS connection countAWS RDS (SQL Server): SSL Connection - The target principal name is incorrectAWS RDS db.t2 instance performance thresholds & monitoringAWS RDS Postgres performance issueCombining EC2 with S3 and RDS from AWS AmazonDetermine why 100% of Mysql CPU is being usedAWS RDS: random spikes in Freeable Memory and Swap Usage

What are the motivations for publishing new editions of an existing textbook, beyond new discoveries in a field?

Does a dangling wire really electrocute me if I'm standing in water?

How to create dashed lines/arrows in Illustrator

How to manage monthly salary

What is the steepest angle that a canal can be traversable without locks?

Access elements in std::string where positon of string is greater than its size

Is it possible for the two major parties in the UK to form a coalition with each other instead of a much smaller party?

Why could you hear an Amstrad CPC working?

Manuscript was "unsubmitted" because the manuscript was deposited in Arxiv Preprints

Time travel alters history but people keep saying nothing's changed

Carnot-Caratheodory metric

How was Skylab's orbit inclination chosen?

Why Did Howard Stark Use All The Vibranium They Had On A Prototype Shield?

Why is it "Tumoren" and not "Tumore"?

Deadlock Graph and Interpretation, solution to avoid

Feasability of miniature nuclear reactors for humanoid cyborgs

Springs with some finite mass

JSON.serialize: is it possible to suppress null values of a map?

Any good smartcontract for "business calendar" oracles?

How to make payment on the internet without leaving a money trail?

Why do UK politicians seemingly ignore opinion polls on Brexit?

What tool would a Roman-age civilisation use to reduce/breakup silver and other metals?

Evaluating number of iteration with a certain map with While

Inflated grade on resume at previous job, might former employer tell new employer?



AWS RDS connection limits



The 2019 Stack Overflow Developer Survey Results Are InPoor performance on Amazon RDS instanceAWS - bigger EC2 instance or DB splitAWS RDS connection countAWS RDS (SQL Server): SSL Connection - The target principal name is incorrectAWS RDS db.t2 instance performance thresholds & monitoringAWS RDS Postgres performance issueCombining EC2 with S3 and RDS from AWS AmazonDetermine why 100% of Mysql CPU is being usedAWS RDS: random spikes in Freeable Memory and Swap Usage



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








34















RDS server come up with 40 connection max, as in the following documentation

I am using Magento 1.9, and at some points, i reach the max number then website is out of service.

Do you have any recommended way to solve this issue?



From my understanding, if i have 2 web servers connection to an RDS server.. then I should have 2 RDS connections, not more.










share|improve this question

















  • 1





    "From my understanding, if i have 2 web servers connection to an RDS server.. then I should have 2 RDS connections, not more." That's an incorrect understanding. It's typically 1 connection per worker process or thread.

    – Michael - sqlbot
    Jul 16 '17 at 13:58











  • Thanks @Michael-sqlbot .. Yes i misunderstand this, but i wanted to make sure. But, why when we have 40 connection coming to RDS it refuses other connection and be unreachable till other connections are closed?

    – Alaa Badran
    Jul 17 '17 at 5:39











  • That's by design, from the max_connections parameter. For most workloads, you should be able to safely increase it, because it's a safely conservative default value... but you'll want to investigate the cause of those spikes.

    – Michael - sqlbot
    Jul 17 '17 at 8:46

















34















RDS server come up with 40 connection max, as in the following documentation

I am using Magento 1.9, and at some points, i reach the max number then website is out of service.

Do you have any recommended way to solve this issue?



From my understanding, if i have 2 web servers connection to an RDS server.. then I should have 2 RDS connections, not more.










share|improve this question

















  • 1





    "From my understanding, if i have 2 web servers connection to an RDS server.. then I should have 2 RDS connections, not more." That's an incorrect understanding. It's typically 1 connection per worker process or thread.

    – Michael - sqlbot
    Jul 16 '17 at 13:58











  • Thanks @Michael-sqlbot .. Yes i misunderstand this, but i wanted to make sure. But, why when we have 40 connection coming to RDS it refuses other connection and be unreachable till other connections are closed?

    – Alaa Badran
    Jul 17 '17 at 5:39











  • That's by design, from the max_connections parameter. For most workloads, you should be able to safely increase it, because it's a safely conservative default value... but you'll want to investigate the cause of those spikes.

    – Michael - sqlbot
    Jul 17 '17 at 8:46













34












34








34


13






RDS server come up with 40 connection max, as in the following documentation

I am using Magento 1.9, and at some points, i reach the max number then website is out of service.

Do you have any recommended way to solve this issue?



From my understanding, if i have 2 web servers connection to an RDS server.. then I should have 2 RDS connections, not more.










share|improve this question














RDS server come up with 40 connection max, as in the following documentation

I am using Magento 1.9, and at some points, i reach the max number then website is out of service.

Do you have any recommended way to solve this issue?



From my understanding, if i have 2 web servers connection to an RDS server.. then I should have 2 RDS connections, not more.







amazon-web-services database rds amazon-rds






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jul 16 '17 at 8:59









Alaa BadranAlaa Badran

273136




273136







  • 1





    "From my understanding, if i have 2 web servers connection to an RDS server.. then I should have 2 RDS connections, not more." That's an incorrect understanding. It's typically 1 connection per worker process or thread.

    – Michael - sqlbot
    Jul 16 '17 at 13:58











  • Thanks @Michael-sqlbot .. Yes i misunderstand this, but i wanted to make sure. But, why when we have 40 connection coming to RDS it refuses other connection and be unreachable till other connections are closed?

    – Alaa Badran
    Jul 17 '17 at 5:39











  • That's by design, from the max_connections parameter. For most workloads, you should be able to safely increase it, because it's a safely conservative default value... but you'll want to investigate the cause of those spikes.

    – Michael - sqlbot
    Jul 17 '17 at 8:46












  • 1





    "From my understanding, if i have 2 web servers connection to an RDS server.. then I should have 2 RDS connections, not more." That's an incorrect understanding. It's typically 1 connection per worker process or thread.

    – Michael - sqlbot
    Jul 16 '17 at 13:58











  • Thanks @Michael-sqlbot .. Yes i misunderstand this, but i wanted to make sure. But, why when we have 40 connection coming to RDS it refuses other connection and be unreachable till other connections are closed?

    – Alaa Badran
    Jul 17 '17 at 5:39











  • That's by design, from the max_connections parameter. For most workloads, you should be able to safely increase it, because it's a safely conservative default value... but you'll want to investigate the cause of those spikes.

    – Michael - sqlbot
    Jul 17 '17 at 8:46







1




1





"From my understanding, if i have 2 web servers connection to an RDS server.. then I should have 2 RDS connections, not more." That's an incorrect understanding. It's typically 1 connection per worker process or thread.

– Michael - sqlbot
Jul 16 '17 at 13:58





"From my understanding, if i have 2 web servers connection to an RDS server.. then I should have 2 RDS connections, not more." That's an incorrect understanding. It's typically 1 connection per worker process or thread.

– Michael - sqlbot
Jul 16 '17 at 13:58













Thanks @Michael-sqlbot .. Yes i misunderstand this, but i wanted to make sure. But, why when we have 40 connection coming to RDS it refuses other connection and be unreachable till other connections are closed?

– Alaa Badran
Jul 17 '17 at 5:39





Thanks @Michael-sqlbot .. Yes i misunderstand this, but i wanted to make sure. But, why when we have 40 connection coming to RDS it refuses other connection and be unreachable till other connections are closed?

– Alaa Badran
Jul 17 '17 at 5:39













That's by design, from the max_connections parameter. For most workloads, you should be able to safely increase it, because it's a safely conservative default value... but you'll want to investigate the cause of those spikes.

– Michael - sqlbot
Jul 17 '17 at 8:46





That's by design, from the max_connections parameter. For most workloads, you should be able to safely increase it, because it's a safely conservative default value... but you'll want to investigate the cause of those spikes.

– Michael - sqlbot
Jul 17 '17 at 8:46










5 Answers
5






active

oldest

votes


















56














AWS RDS max_connections limit variable is based on Instance type, so you can upgrade your RDS or make more replica.



The RDS types with max_connections limit:



  • t2.micro 66

  • t2.small 150

  • m3.medium 296

  • t2.medium 312

  • m3.large 609

  • t2.large 648

  • m4.large 648

  • m3.xlarge 1237

  • r3.large 1258

  • m4.xlarge 1320

  • m2.xlarge 1412

  • m3.2xlarge 2492

  • r3.xlarge 2540


Referring by max_connections at AWS RDS MySQL Instance Sizes in 2015




Update 2017-07



The current RDS MySQL max_connections setting is default by DBInstanceClassMemory/12582880, if you use t2.micro with 512MB RAM, the max_connections could be (512*1024*1024)/12582880 ~= 40, and so on.




Each Web server could have many connections to RDS, which depends on your SQL requests from Web server.






share|improve this answer

























  • I know this, but when when reaching 40 connections, the server doesn't respond? Check this: drive.google.com/file/d/0B-_uggt0MBYOZElEMEItWDIwUEk/…

    – Alaa Badran
    Jul 17 '17 at 5:45











  • @AlaaBadran What is your instance type of the RDS?

    – Nick Tsai
    Jul 17 '17 at 7:51






  • 1





    I check the RDS Parameter Groups, the max_connections is default by DBInstanceClassMemory/12582880, so when you use t2.micro with 512MB RAM, the max_connections could be (512*1024*1024)/12582880 = 40.69 which could explain your 40 max connections.

    – Nick Tsai
    Jul 17 '17 at 7:59






  • 2





    You could check the value by querying that RDS MySQL with command show variables like 'max_connections';.

    – Nick Tsai
    Jul 17 '17 at 14:00







  • 1





    You can create a new parameter group and change the value of max_connections to the value you want. This will be the new connection limit for your RDS instance.

    – backslashN
    Mar 26 at 8:46


















23














You can change the max_connections value by either updating the default parameter policy or create a new one - I'd suggest going with the latter.



  • Go to RDS

  • Parameter Groups

  • Create a new Parameter Group (AWS wil leave everything as default)

  • search for the max_connections value

  • Change the value to use

  • Go to RDS instance and modify

  • Select new Parameter group created and restart the instance or let AWS reboot it during next maintenance window

Hope this helps!






share|improve this answer




















  • 2





    <3 this should be the accepted answer

    – bbozo
    Apr 5 '18 at 15:11






  • 1





    even though I set max_connections to 1000, rds still only allowed 100 max connections on a micro instance

    – Miguel Mota
    Apr 12 '18 at 19:14



















1














While increasing the max connections on the server config may fix the problem, you should consider verifying your application configurations and implementations.



I'm not an expert on Magento, but as I recently had a similar issue on a project I was working on, I noticed that the default implementation of the framework I was using created a connection with every call to the database.



While that may not cause any problems to some, the moment you have more visitors or some tasks that are database intensive and can run on multiple connections, the best way to prevent the server crashing with "TOO MANY CONNECTIONS" error is to implement a database connection pool.



This prevents the application from creating more connections that the server can handle, and not crashing the application to the users. A connection pool would keep a queue for the requests to access the database until a connection becomes available so it can proceed with processing the users request.



Just keep in mind that the connection pool should be thread safe in a multi thread scenario.






share|improve this answer






























    1














    Login to your RDS instance (using a MySQL client) and run the following query:



    SHOW VARIABLES LIKE 'max_connections';





    share|improve this answer






























      0














      That's not 40 connections max, that is 40 RDS instances max. You are most likely only using 1 instance based on your description.



      You can have thousands of connections to the RDS server because each time a session is opened with the database, that creates a new connection. You are probably running into performance constraints and should look into making the RDS instance larger.






      share|improve this answer























      • Thanks @jason I have the following information: When reaching 40 connection, RDS doesn't respond till other connections close. We have r3.xlarge RDS instance. Here is a screenshot of this: drive.google.com/file/d/0B-_uggt0MBYOZElEMEItWDIwUEk/… We have idle CPU with high number of connections

        – Alaa Badran
        Jul 17 '17 at 5:41












      • This is connections, not other thing

        – Orlando
        Jan 6 '18 at 22:28











      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%2f862387%2faws-rds-connection-limits%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      5 Answers
      5






      active

      oldest

      votes








      5 Answers
      5






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      56














      AWS RDS max_connections limit variable is based on Instance type, so you can upgrade your RDS or make more replica.



      The RDS types with max_connections limit:



      • t2.micro 66

      • t2.small 150

      • m3.medium 296

      • t2.medium 312

      • m3.large 609

      • t2.large 648

      • m4.large 648

      • m3.xlarge 1237

      • r3.large 1258

      • m4.xlarge 1320

      • m2.xlarge 1412

      • m3.2xlarge 2492

      • r3.xlarge 2540


      Referring by max_connections at AWS RDS MySQL Instance Sizes in 2015




      Update 2017-07



      The current RDS MySQL max_connections setting is default by DBInstanceClassMemory/12582880, if you use t2.micro with 512MB RAM, the max_connections could be (512*1024*1024)/12582880 ~= 40, and so on.




      Each Web server could have many connections to RDS, which depends on your SQL requests from Web server.






      share|improve this answer

























      • I know this, but when when reaching 40 connections, the server doesn't respond? Check this: drive.google.com/file/d/0B-_uggt0MBYOZElEMEItWDIwUEk/…

        – Alaa Badran
        Jul 17 '17 at 5:45











      • @AlaaBadran What is your instance type of the RDS?

        – Nick Tsai
        Jul 17 '17 at 7:51






      • 1





        I check the RDS Parameter Groups, the max_connections is default by DBInstanceClassMemory/12582880, so when you use t2.micro with 512MB RAM, the max_connections could be (512*1024*1024)/12582880 = 40.69 which could explain your 40 max connections.

        – Nick Tsai
        Jul 17 '17 at 7:59






      • 2





        You could check the value by querying that RDS MySQL with command show variables like 'max_connections';.

        – Nick Tsai
        Jul 17 '17 at 14:00







      • 1





        You can create a new parameter group and change the value of max_connections to the value you want. This will be the new connection limit for your RDS instance.

        – backslashN
        Mar 26 at 8:46















      56














      AWS RDS max_connections limit variable is based on Instance type, so you can upgrade your RDS or make more replica.



      The RDS types with max_connections limit:



      • t2.micro 66

      • t2.small 150

      • m3.medium 296

      • t2.medium 312

      • m3.large 609

      • t2.large 648

      • m4.large 648

      • m3.xlarge 1237

      • r3.large 1258

      • m4.xlarge 1320

      • m2.xlarge 1412

      • m3.2xlarge 2492

      • r3.xlarge 2540


      Referring by max_connections at AWS RDS MySQL Instance Sizes in 2015




      Update 2017-07



      The current RDS MySQL max_connections setting is default by DBInstanceClassMemory/12582880, if you use t2.micro with 512MB RAM, the max_connections could be (512*1024*1024)/12582880 ~= 40, and so on.




      Each Web server could have many connections to RDS, which depends on your SQL requests from Web server.






      share|improve this answer

























      • I know this, but when when reaching 40 connections, the server doesn't respond? Check this: drive.google.com/file/d/0B-_uggt0MBYOZElEMEItWDIwUEk/…

        – Alaa Badran
        Jul 17 '17 at 5:45











      • @AlaaBadran What is your instance type of the RDS?

        – Nick Tsai
        Jul 17 '17 at 7:51






      • 1





        I check the RDS Parameter Groups, the max_connections is default by DBInstanceClassMemory/12582880, so when you use t2.micro with 512MB RAM, the max_connections could be (512*1024*1024)/12582880 = 40.69 which could explain your 40 max connections.

        – Nick Tsai
        Jul 17 '17 at 7:59






      • 2





        You could check the value by querying that RDS MySQL with command show variables like 'max_connections';.

        – Nick Tsai
        Jul 17 '17 at 14:00







      • 1





        You can create a new parameter group and change the value of max_connections to the value you want. This will be the new connection limit for your RDS instance.

        – backslashN
        Mar 26 at 8:46













      56












      56








      56







      AWS RDS max_connections limit variable is based on Instance type, so you can upgrade your RDS or make more replica.



      The RDS types with max_connections limit:



      • t2.micro 66

      • t2.small 150

      • m3.medium 296

      • t2.medium 312

      • m3.large 609

      • t2.large 648

      • m4.large 648

      • m3.xlarge 1237

      • r3.large 1258

      • m4.xlarge 1320

      • m2.xlarge 1412

      • m3.2xlarge 2492

      • r3.xlarge 2540


      Referring by max_connections at AWS RDS MySQL Instance Sizes in 2015




      Update 2017-07



      The current RDS MySQL max_connections setting is default by DBInstanceClassMemory/12582880, if you use t2.micro with 512MB RAM, the max_connections could be (512*1024*1024)/12582880 ~= 40, and so on.




      Each Web server could have many connections to RDS, which depends on your SQL requests from Web server.






      share|improve this answer















      AWS RDS max_connections limit variable is based on Instance type, so you can upgrade your RDS or make more replica.



      The RDS types with max_connections limit:



      • t2.micro 66

      • t2.small 150

      • m3.medium 296

      • t2.medium 312

      • m3.large 609

      • t2.large 648

      • m4.large 648

      • m3.xlarge 1237

      • r3.large 1258

      • m4.xlarge 1320

      • m2.xlarge 1412

      • m3.2xlarge 2492

      • r3.xlarge 2540


      Referring by max_connections at AWS RDS MySQL Instance Sizes in 2015




      Update 2017-07



      The current RDS MySQL max_connections setting is default by DBInstanceClassMemory/12582880, if you use t2.micro with 512MB RAM, the max_connections could be (512*1024*1024)/12582880 ~= 40, and so on.




      Each Web server could have many connections to RDS, which depends on your SQL requests from Web server.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Jul 17 '17 at 8:04

























      answered Jul 16 '17 at 14:55









      Nick TsaiNick Tsai

      69847




      69847












      • I know this, but when when reaching 40 connections, the server doesn't respond? Check this: drive.google.com/file/d/0B-_uggt0MBYOZElEMEItWDIwUEk/…

        – Alaa Badran
        Jul 17 '17 at 5:45











      • @AlaaBadran What is your instance type of the RDS?

        – Nick Tsai
        Jul 17 '17 at 7:51






      • 1





        I check the RDS Parameter Groups, the max_connections is default by DBInstanceClassMemory/12582880, so when you use t2.micro with 512MB RAM, the max_connections could be (512*1024*1024)/12582880 = 40.69 which could explain your 40 max connections.

        – Nick Tsai
        Jul 17 '17 at 7:59






      • 2





        You could check the value by querying that RDS MySQL with command show variables like 'max_connections';.

        – Nick Tsai
        Jul 17 '17 at 14:00







      • 1





        You can create a new parameter group and change the value of max_connections to the value you want. This will be the new connection limit for your RDS instance.

        – backslashN
        Mar 26 at 8:46

















      • I know this, but when when reaching 40 connections, the server doesn't respond? Check this: drive.google.com/file/d/0B-_uggt0MBYOZElEMEItWDIwUEk/…

        – Alaa Badran
        Jul 17 '17 at 5:45











      • @AlaaBadran What is your instance type of the RDS?

        – Nick Tsai
        Jul 17 '17 at 7:51






      • 1





        I check the RDS Parameter Groups, the max_connections is default by DBInstanceClassMemory/12582880, so when you use t2.micro with 512MB RAM, the max_connections could be (512*1024*1024)/12582880 = 40.69 which could explain your 40 max connections.

        – Nick Tsai
        Jul 17 '17 at 7:59






      • 2





        You could check the value by querying that RDS MySQL with command show variables like 'max_connections';.

        – Nick Tsai
        Jul 17 '17 at 14:00







      • 1





        You can create a new parameter group and change the value of max_connections to the value you want. This will be the new connection limit for your RDS instance.

        – backslashN
        Mar 26 at 8:46
















      I know this, but when when reaching 40 connections, the server doesn't respond? Check this: drive.google.com/file/d/0B-_uggt0MBYOZElEMEItWDIwUEk/…

      – Alaa Badran
      Jul 17 '17 at 5:45





      I know this, but when when reaching 40 connections, the server doesn't respond? Check this: drive.google.com/file/d/0B-_uggt0MBYOZElEMEItWDIwUEk/…

      – Alaa Badran
      Jul 17 '17 at 5:45













      @AlaaBadran What is your instance type of the RDS?

      – Nick Tsai
      Jul 17 '17 at 7:51





      @AlaaBadran What is your instance type of the RDS?

      – Nick Tsai
      Jul 17 '17 at 7:51




      1




      1





      I check the RDS Parameter Groups, the max_connections is default by DBInstanceClassMemory/12582880, so when you use t2.micro with 512MB RAM, the max_connections could be (512*1024*1024)/12582880 = 40.69 which could explain your 40 max connections.

      – Nick Tsai
      Jul 17 '17 at 7:59





      I check the RDS Parameter Groups, the max_connections is default by DBInstanceClassMemory/12582880, so when you use t2.micro with 512MB RAM, the max_connections could be (512*1024*1024)/12582880 = 40.69 which could explain your 40 max connections.

      – Nick Tsai
      Jul 17 '17 at 7:59




      2




      2





      You could check the value by querying that RDS MySQL with command show variables like 'max_connections';.

      – Nick Tsai
      Jul 17 '17 at 14:00






      You could check the value by querying that RDS MySQL with command show variables like 'max_connections';.

      – Nick Tsai
      Jul 17 '17 at 14:00





      1




      1





      You can create a new parameter group and change the value of max_connections to the value you want. This will be the new connection limit for your RDS instance.

      – backslashN
      Mar 26 at 8:46





      You can create a new parameter group and change the value of max_connections to the value you want. This will be the new connection limit for your RDS instance.

      – backslashN
      Mar 26 at 8:46













      23














      You can change the max_connections value by either updating the default parameter policy or create a new one - I'd suggest going with the latter.



      • Go to RDS

      • Parameter Groups

      • Create a new Parameter Group (AWS wil leave everything as default)

      • search for the max_connections value

      • Change the value to use

      • Go to RDS instance and modify

      • Select new Parameter group created and restart the instance or let AWS reboot it during next maintenance window

      Hope this helps!






      share|improve this answer




















      • 2





        <3 this should be the accepted answer

        – bbozo
        Apr 5 '18 at 15:11






      • 1





        even though I set max_connections to 1000, rds still only allowed 100 max connections on a micro instance

        – Miguel Mota
        Apr 12 '18 at 19:14
















      23














      You can change the max_connections value by either updating the default parameter policy or create a new one - I'd suggest going with the latter.



      • Go to RDS

      • Parameter Groups

      • Create a new Parameter Group (AWS wil leave everything as default)

      • search for the max_connections value

      • Change the value to use

      • Go to RDS instance and modify

      • Select new Parameter group created and restart the instance or let AWS reboot it during next maintenance window

      Hope this helps!






      share|improve this answer




















      • 2





        <3 this should be the accepted answer

        – bbozo
        Apr 5 '18 at 15:11






      • 1





        even though I set max_connections to 1000, rds still only allowed 100 max connections on a micro instance

        – Miguel Mota
        Apr 12 '18 at 19:14














      23












      23








      23







      You can change the max_connections value by either updating the default parameter policy or create a new one - I'd suggest going with the latter.



      • Go to RDS

      • Parameter Groups

      • Create a new Parameter Group (AWS wil leave everything as default)

      • search for the max_connections value

      • Change the value to use

      • Go to RDS instance and modify

      • Select new Parameter group created and restart the instance or let AWS reboot it during next maintenance window

      Hope this helps!






      share|improve this answer















      You can change the max_connections value by either updating the default parameter policy or create a new one - I'd suggest going with the latter.



      • Go to RDS

      • Parameter Groups

      • Create a new Parameter Group (AWS wil leave everything as default)

      • search for the max_connections value

      • Change the value to use

      • Go to RDS instance and modify

      • Select new Parameter group created and restart the instance or let AWS reboot it during next maintenance window

      Hope this helps!







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Apr 5 at 16:44









      Community

      1




      1










      answered Nov 1 '17 at 18:10









      DavidDavid

      23122




      23122







      • 2





        <3 this should be the accepted answer

        – bbozo
        Apr 5 '18 at 15:11






      • 1





        even though I set max_connections to 1000, rds still only allowed 100 max connections on a micro instance

        – Miguel Mota
        Apr 12 '18 at 19:14













      • 2





        <3 this should be the accepted answer

        – bbozo
        Apr 5 '18 at 15:11






      • 1





        even though I set max_connections to 1000, rds still only allowed 100 max connections on a micro instance

        – Miguel Mota
        Apr 12 '18 at 19:14








      2




      2





      <3 this should be the accepted answer

      – bbozo
      Apr 5 '18 at 15:11





      <3 this should be the accepted answer

      – bbozo
      Apr 5 '18 at 15:11




      1




      1





      even though I set max_connections to 1000, rds still only allowed 100 max connections on a micro instance

      – Miguel Mota
      Apr 12 '18 at 19:14






      even though I set max_connections to 1000, rds still only allowed 100 max connections on a micro instance

      – Miguel Mota
      Apr 12 '18 at 19:14












      1














      While increasing the max connections on the server config may fix the problem, you should consider verifying your application configurations and implementations.



      I'm not an expert on Magento, but as I recently had a similar issue on a project I was working on, I noticed that the default implementation of the framework I was using created a connection with every call to the database.



      While that may not cause any problems to some, the moment you have more visitors or some tasks that are database intensive and can run on multiple connections, the best way to prevent the server crashing with "TOO MANY CONNECTIONS" error is to implement a database connection pool.



      This prevents the application from creating more connections that the server can handle, and not crashing the application to the users. A connection pool would keep a queue for the requests to access the database until a connection becomes available so it can proceed with processing the users request.



      Just keep in mind that the connection pool should be thread safe in a multi thread scenario.






      share|improve this answer



























        1














        While increasing the max connections on the server config may fix the problem, you should consider verifying your application configurations and implementations.



        I'm not an expert on Magento, but as I recently had a similar issue on a project I was working on, I noticed that the default implementation of the framework I was using created a connection with every call to the database.



        While that may not cause any problems to some, the moment you have more visitors or some tasks that are database intensive and can run on multiple connections, the best way to prevent the server crashing with "TOO MANY CONNECTIONS" error is to implement a database connection pool.



        This prevents the application from creating more connections that the server can handle, and not crashing the application to the users. A connection pool would keep a queue for the requests to access the database until a connection becomes available so it can proceed with processing the users request.



        Just keep in mind that the connection pool should be thread safe in a multi thread scenario.






        share|improve this answer

























          1












          1








          1







          While increasing the max connections on the server config may fix the problem, you should consider verifying your application configurations and implementations.



          I'm not an expert on Magento, but as I recently had a similar issue on a project I was working on, I noticed that the default implementation of the framework I was using created a connection with every call to the database.



          While that may not cause any problems to some, the moment you have more visitors or some tasks that are database intensive and can run on multiple connections, the best way to prevent the server crashing with "TOO MANY CONNECTIONS" error is to implement a database connection pool.



          This prevents the application from creating more connections that the server can handle, and not crashing the application to the users. A connection pool would keep a queue for the requests to access the database until a connection becomes available so it can proceed with processing the users request.



          Just keep in mind that the connection pool should be thread safe in a multi thread scenario.






          share|improve this answer













          While increasing the max connections on the server config may fix the problem, you should consider verifying your application configurations and implementations.



          I'm not an expert on Magento, but as I recently had a similar issue on a project I was working on, I noticed that the default implementation of the framework I was using created a connection with every call to the database.



          While that may not cause any problems to some, the moment you have more visitors or some tasks that are database intensive and can run on multiple connections, the best way to prevent the server crashing with "TOO MANY CONNECTIONS" error is to implement a database connection pool.



          This prevents the application from creating more connections that the server can handle, and not crashing the application to the users. A connection pool would keep a queue for the requests to access the database until a connection becomes available so it can proceed with processing the users request.



          Just keep in mind that the connection pool should be thread safe in a multi thread scenario.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 21 '18 at 14:24









          Uriel BertocheUriel Bertoche

          1111




          1111





















              1














              Login to your RDS instance (using a MySQL client) and run the following query:



              SHOW VARIABLES LIKE 'max_connections';





              share|improve this answer



























                1














                Login to your RDS instance (using a MySQL client) and run the following query:



                SHOW VARIABLES LIKE 'max_connections';





                share|improve this answer

























                  1












                  1








                  1







                  Login to your RDS instance (using a MySQL client) and run the following query:



                  SHOW VARIABLES LIKE 'max_connections';





                  share|improve this answer













                  Login to your RDS instance (using a MySQL client) and run the following query:



                  SHOW VARIABLES LIKE 'max_connections';






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Sep 4 '18 at 16:36









                  Shammi ShailajShammi Shailaj

                  111




                  111





















                      0














                      That's not 40 connections max, that is 40 RDS instances max. You are most likely only using 1 instance based on your description.



                      You can have thousands of connections to the RDS server because each time a session is opened with the database, that creates a new connection. You are probably running into performance constraints and should look into making the RDS instance larger.






                      share|improve this answer























                      • Thanks @jason I have the following information: When reaching 40 connection, RDS doesn't respond till other connections close. We have r3.xlarge RDS instance. Here is a screenshot of this: drive.google.com/file/d/0B-_uggt0MBYOZElEMEItWDIwUEk/… We have idle CPU with high number of connections

                        – Alaa Badran
                        Jul 17 '17 at 5:41












                      • This is connections, not other thing

                        – Orlando
                        Jan 6 '18 at 22:28















                      0














                      That's not 40 connections max, that is 40 RDS instances max. You are most likely only using 1 instance based on your description.



                      You can have thousands of connections to the RDS server because each time a session is opened with the database, that creates a new connection. You are probably running into performance constraints and should look into making the RDS instance larger.






                      share|improve this answer























                      • Thanks @jason I have the following information: When reaching 40 connection, RDS doesn't respond till other connections close. We have r3.xlarge RDS instance. Here is a screenshot of this: drive.google.com/file/d/0B-_uggt0MBYOZElEMEItWDIwUEk/… We have idle CPU with high number of connections

                        – Alaa Badran
                        Jul 17 '17 at 5:41












                      • This is connections, not other thing

                        – Orlando
                        Jan 6 '18 at 22:28













                      0












                      0








                      0







                      That's not 40 connections max, that is 40 RDS instances max. You are most likely only using 1 instance based on your description.



                      You can have thousands of connections to the RDS server because each time a session is opened with the database, that creates a new connection. You are probably running into performance constraints and should look into making the RDS instance larger.






                      share|improve this answer













                      That's not 40 connections max, that is 40 RDS instances max. You are most likely only using 1 instance based on your description.



                      You can have thousands of connections to the RDS server because each time a session is opened with the database, that creates a new connection. You are probably running into performance constraints and should look into making the RDS instance larger.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Jul 16 '17 at 14:00









                      jason sjason s

                      171




                      171












                      • Thanks @jason I have the following information: When reaching 40 connection, RDS doesn't respond till other connections close. We have r3.xlarge RDS instance. Here is a screenshot of this: drive.google.com/file/d/0B-_uggt0MBYOZElEMEItWDIwUEk/… We have idle CPU with high number of connections

                        – Alaa Badran
                        Jul 17 '17 at 5:41












                      • This is connections, not other thing

                        – Orlando
                        Jan 6 '18 at 22:28

















                      • Thanks @jason I have the following information: When reaching 40 connection, RDS doesn't respond till other connections close. We have r3.xlarge RDS instance. Here is a screenshot of this: drive.google.com/file/d/0B-_uggt0MBYOZElEMEItWDIwUEk/… We have idle CPU with high number of connections

                        – Alaa Badran
                        Jul 17 '17 at 5:41












                      • This is connections, not other thing

                        – Orlando
                        Jan 6 '18 at 22:28
















                      Thanks @jason I have the following information: When reaching 40 connection, RDS doesn't respond till other connections close. We have r3.xlarge RDS instance. Here is a screenshot of this: drive.google.com/file/d/0B-_uggt0MBYOZElEMEItWDIwUEk/… We have idle CPU with high number of connections

                      – Alaa Badran
                      Jul 17 '17 at 5:41






                      Thanks @jason I have the following information: When reaching 40 connection, RDS doesn't respond till other connections close. We have r3.xlarge RDS instance. Here is a screenshot of this: drive.google.com/file/d/0B-_uggt0MBYOZElEMEItWDIwUEk/… We have idle CPU with high number of connections

                      – Alaa Badran
                      Jul 17 '17 at 5:41














                      This is connections, not other thing

                      – Orlando
                      Jan 6 '18 at 22:28





                      This is connections, not other thing

                      – Orlando
                      Jan 6 '18 at 22:28

















                      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%2f862387%2faws-rds-connection-limits%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

                      Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

                      Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

                      What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company