Too many connections - limit of 150 reached

We ran into a situation where a program (written in PHP, running under Apache) was spawned via crontab every 30 seconds for test purposes. It connected to the database but did not disconnect.
Net result: Once the program had been started 150 times, the database refused any more connections. No valid users could connect. I couldn't even connect from the oracle privileged account.
Item 1: The process will be modified to explicitly close its connection when done, rather than trusting the job to default behavior of PHP. So, hopefully, we will not run into this a second time.
Item 2: But if we do have this problem again, I need to know how to intervene when the connection limit has been reached. I was not able to connect myself and therefore could not query v$process or related tables to gather any information. I could kill the various (useless) listener processes at the unix command line, but it still took time for Oracle to sense the dead process and mop up. How to accomplish this quickly?
Item 3: I can probably set up the rogue process to login as a different user and then set a resource profile for that user including timeouts. Any suggestions on values for that resource profile?
Item 4: Is there a way to reserve a listener connection for a privileged account such as the DBA?
Thanks for any guidance.
-- Chris Curzon

ChrisCurzonDBA wrote:
Thanks for the friendly reply.
What worried me was that I had to wait for the useless connections to clear, before I could connect and see what the sessions were. Yes, Oracle had to roll back any uncommitted work, and there's no way to speed that up, but I wanted to see that processes from inside of Oracle (connected) not from outside.
Is it possible to configure the listener to "reserve" one connection for a privileged account? No.
It is not the listener's responsibility. In fact, it is not even the listener's responsibility to maintain existing connections. Once the listener services the connection request, it is totally out of the picture. You can even kill the listener, and any existing connections will continue on. It's like being introduced to someone at a party. Once you are introduced to someone (by The Listener), you carry on your conversation with that person directly, not through the person (The Listener) who introduced you.
>
-- Chris

Similar Messages

  • Sendmail in Solaris 10 - 554 Too many connections from origin

    I recently upgraded a server from Solaris 9 to Solaris 10. One of the apps that worked fine on S9 is now having a problem. I believe I have discovered the cause, but I'm not having any luck coming up with a solution.
    The app in question queries a database for a list of e-mail addresses (all within our own domain) and then sends e-mail to each user. The messages are sent to our Barracuda firewall/spam filtering appliance, and it relays the messages on to our Exchange server.
    The problem that arose after the upgrade is that sendmail is opening too many concurrent connections to the Barracuda, and the 'Cuda is replying with "554 Too many connections from origin".
    I see that there is a sendmail configuration parameter "SingleThreadDelivery" that will only allow one connection to the Barracuda at a time. That appears to be overly restrictive, though.
    My question is this: is there a way to tell sendmail to only allow some number of concurrent connections to the 'Cuda so as not to hit this limit?
    Thanks,
    Bill

    Glen,
    Thanks for the reply.
    Yes, I did look at those, but my understanding was that those parameters effect inbound connection and in our case, the problem is that we want to limit the number of outbound connections.
    As it turns out, the S10 upgrade was not the cause of this problem. At the same time that we upgraded we also added a second network interface (and IP address). Unknown to either myself or the current Barracuda admin, the old IP had been configured into the 'Cuda so that rate limits did not apply. The fix was to add the second IP, too (well actually, he decided to open it up to all of our servers' internal IPs).
    Bill

  • Opening multiple reports in Crystal Reports for VS causes database connect limit to be reached.  Seems to be no way to force Crystal Reports to close database connection (other than exiting application)

    I am working on upgrading an application that has been in use for many years.  The application is written in VB6 and I have been tasked with upgrading the current application to Crystal Reports for Visual Studio.  I am using Crystal Reports for VS Version 13.0.12.1494.  The system's database is a Sybase SQL Anywhere 16 database with an ODBC connection using integrated login.  Each of the reports has the database connection set up from within the report.  There is only once database server, so each of the reports are pointing to the same DB.  The database server is currently installed as a "Personal Server" with a limit of 10 connections. 
    I have implemented the CR viewer as part of a COM-callable wrapper that exposes a COM interface for VB6 to interact with.  Inside of my viewer component is a Winform that embeds the Crystal's Report viewer.  The COM interface basically maps the basic Crystal apis to methods that the VB6 can call (i.e., Load Report, Set Field Text, Update SQL Query, etc).  This architecture is working as designed and the reports are displaying correctly and responding correctly to changes in queries, etc.
    The issue is that after I open 9 reports, the tenth one will respond with an error indicating that the database connection limit has been reached.  The database connections used by the reports aren't released until after the application is closed.  The application is designed for a secure environment that prohibits the non-administrative user from accessing the systems desktop, so asking the user tor restart the application after 10 reports isn't a viable option.
    I have checked and database connection pooling is turned off for the SQL Anywhere 16 driver.
    I have been digging on this for a few days and have tried adding code in the FormClosed event to close and dispose of the Report Document as follows:
    ReportDocument reportDoc= (ReportDocument) crystalReportViewer1.ReportSource;
    reportDoc.Close();
    reportDoc.Dispose();
    GC.Collect();       // Force garbage collection on disposed items
    I have also tried the following (as well as maybe 20 or so other permutations) trying to fix the issue with no success.  
    ReportDocument reportDoc= (ReportDocument) crystalReportViewer1.ReportSource;
    foreach (Table table in reportDoc.Database.Tables)
         table.Dispose();
    crystalReportViewer1.ReportSource = null;
    reportDoc.Database.Dispose();
    reportDoc.Close();
    reportDoc.Dispose();
    reportDoc = (ReportDocument)crystalReportViewer1.ReportSource;
    GC.Collect();       // Force garabe collection on disposed items
    Any ideas or suggestions would be greatly appreciated.  I have been pulling my hair out on this one!

    Hi Ludek,
    Thanks so much for the quick reply.  Unfortunately I did not have time to work on the reporting project Friday afternoon, but did a quick test this morning with some interesting results.  I'm hoping if I describe what I'm doing, you can show me the error of my ways.  This is really my first major undertaking with Crystal Reports.
    If I simply load the report, then close and dispose, I don't hit the limit of 10 files.  Note that I do not logon manually in my code as the logon parameters are all defined within the reports themselves.  The logon happens when you actually view the report.  Loading the report doesn't seem to actually log in to the DB.
    What I did was create a very simple form with a single button that creates the WinForm class which contains the Crystal Viewer.  It then loads the report, sets the ReportSource property on the CrystalReportsViewer object contained in the WInForm and shows the report. The report does show correctly, until the 10 reports limit is reached.
    The relevant code is shown below. More than I wanted to post, but i want to be as complete and unambiguous as possible. 
    This code displays the same behavior as my earlier post (after 10 reports we are unable to create another connection to the DB).
    // Initial Form that simply has a button
      public partial class SlectReport : form
            public SelectReport()
                InitializeComponent();
            private void button1_Click(object sender, EventArgs e)
                ReportDocument rd = new ReportDocument();
                ReportForm report = new ReportForm();
                try
                    rd.Load(@"Test.rpt");
                    report.ReportSource = rd;
                    report.Show();
             catch (Exception ex)
                  MessageBox.Show(ex.Message);
    // The WinForm containing the Crystal Reports Viewer
        public partial class ReportForm : Form
            public ReportForm()
                InitializeComponent();
            private void Form1_Load(object sender, EventArgs e)
                this.crystalReportViewer1.RefreshReport();
                this.FormClosed += new FormClosedEventHandler(ReportForm_FormClosed);
            void ReportForm_FormClosed(object sender, FormClosedEventArgs e)
                ReportDocument rd;
                rd = (ReportDocument)crystalReportViewer1.ReportSource;
                rd.Close();
                rd.Dispose();
            public object ReportSource
                set { crystalReportViewer1.ReportSource = value; }
    Again, any guidance would be greatly appreciated. 

  • Too many connections - even after closing ResultSets and PreparedStatements

    I'm getting a "Too many connections" error with MySQL when I run my Java program.
    2007-08-06 15:07:26,650 main/CLIRuntime [FATAL]: Too many connections
    com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Too many connections
            at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:921)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:812)
            at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3269)
            at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1182)
            at com.mysql.jdbc.Connection.createNewIO(Connection.java:2670)I researched on this and found out that I wasn't closing the ResultSet and the PreparedStatement.
    The JDBC connection is closed by a central program that handles connections (custom connection pooling).
    I added the code to close all ResultSets and PreparedStatements, and re-started MySQL as per the instructions here
    but still get "Too many connections" error.
    A few other things come to mind, as to what I may be doing wrong, so I have a few questions:
    1) A few PreparedStatements are created in one method, and they are used in a 2nd method and closed in the 2nd method
    does this cause "Too many connections" error?
    2) I have 2 different ResultSets, in nested while loops where the outer loop iterates over the first ResultSet and
    the inner loop iterates over the second ResultSet.
    I have a try-finally block that wraps the inner while loop, and I'm closing the second ResultSet and PreparedStement
    in the inner while loop.
    I also have a try-finally block that wraps the outer while loop, and I'm closing the first ResulSet and PreparedStatement
    in the outer while loop as soon as the inner while loop completes.
    So, in the above case the outer while loop's ResultSet and PreparedStatements remain open until the inner while loop completes.
    Does the above cause "Too many connections" error?
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The following is relevant sections of my code ( it is partially pseudo-code ) that shows the above 2 cases:
    init( Connection jdbcConnection ){
       String firstSQLStatement = "....";
       PreparedStatement ps1 = jdbcConnection.prepareStatement( firstSQLStatement );
       String secondSQLStatement = "....";
       PreparedStatement ps2 = jdbcConnection.prepareStatement( secondSQLStatement );
       String thirdSQLStatement = "....";
       PreparedStatement ps3 = null;
       ResultSet rsA = null;
       try{
            ps3 = jdbcConnection.prepareStatement( thirdSQLStatement );
            rsA = ps3.executeQuery();
            if( rsA.next() ){
                   rsA.getString( 1 );
       }finally{
            if( rsA != null )
                   rsA.close();
            if( ps3 != null )
              ps3.close();
       //Notice, how ps1 and ps2 are created here but not used immediately, but only ps3 is
       //used immediately.
       //ps1 and ps2 are used in another method.
    run( Connection jdbcConnection ){
         ResultSet rs1 = ps1.executeQuery();
            try{
               while(rs1.next()){
                    String s = rs1.getString();
                    ps2.setString(1, s);
              ResultSet rs2 = ps2.executeQuery();
                    try{
                   while(rs2.next()){
                        String s2 = rs2.getString();
                    }finally{
                   if( rs2 != null )
                     rs2.close();
                   if( ps2 != null )
                     ps2.close();
         }catch( Exception e ){
              e.printStackTrace();
         }finally{
            if( rs1 != null )
                  rs1.close();
               if( ps1 != null )
                  ps1.close();
    //Notice in the above case rs1 and ps1 are closed only after the inner
    //while loop completes.
    }I appreciate any help.

    Thanks for your reply.
    I will look at the central connection pooling mechanism ( which was written by someone else) , but that is being used by many other Java programs others have written.
    They are not getting this error.
    An addendum to my previous note, I followed the instructions here.
    http://dev.mysql.com/doc/refman/5.0/en/too-many-connections.html
    There's probably something else in my code that is not closing the connection.
    But I just wanted to rule out the fact that opening a PreparedStatement in one method and closing it in another is not a problem.
    Or, if nested ResultSet loops don't cause the problem.
    I've read in a few threads taht "Too many connections" can occur for unclosed RS and PS , and not just JDBC connections.

  • ICloud mail "Too many connections" error

    Anyone ever gotten this error when sending to an @me.com account? This is what it looks like when I send email to myself using it. My gut says it's a Boxcar issue but I haven't used that service in months and I've now disconnected anything from it. This is the error I'm seeing back when sending email to my iCloud account:
    This report relates to a message you sent with the following header fields:
    Message-id: <[email protected]>
    Date: Wed, 07 Nov 2012 14:29:50 -0500
    From: Brad Franklin <[email protected]>
    To: Brad Franklin <[email protected]>
    Subject: Test
    Your message cannot be delivered to the following recipients:
    Recipient address: [email protected]
    Original address: [email protected]
    Reason: Rejection greeting returned by server.
    Diagnostic code: smtp;554 Transaction failed. Too many connections.
    Remote system: dns;push.boxcar.io (TCP|17.172.204.240|45227|173.192.56.11|25) (Transaction failed. Too many connections.)
    Original-envelope-id: [email protected]
    Reporting-MTA: dns;st11p01mm-asmtp005.mac.com (tcp-daemon)
    Arrival-date: Wed, 07 Nov 2012 19:29:54 +0000 (GMT)
    Original-recipient: rfc822;[email protected]
    Final-recipient: rfc822;[email protected]
    Action: failed
    Status: 5.0.0 (Rejection greeting returned by server.)
    Remote-MTA: dns;push.boxcar.io (TCP|17.172.204.240|45227|173.192.56.11|25)
    (Transaction failed. Too many connections.)
    Diagnostic-code: smtp;554 Transaction failed. Too many connections.

    I'm also having this issue with two of my accounts (the main ones I use the most!) I get this message:

  • Mail Alert with Triangle Exclamation Mark with iMap - Too Many Connections?

    I have one Laptop (Macbook mid-07) on Leopard 10.5.6 and a Macbook Pro 09 on Leopard 10.5.8. I just switched over to iMap where I have two email accounts set up on both laptops. Both laptops have identical accounts set up on them.
    I'm currently geting the triangle with the exclamation mark alert on the inboxes of both accounts when both laptops have Apple Mail open. Is this an issue with Apple Mail or my Service Provider possibly complaining that I have too many connections? I don't get these alerts when only one laptop has the Mail App open. The alert reads:
    Alert
    There may be a problem with the mail server or the network. Check the settings for the account "IMAP" or try again.
    The server error encountered was: The attempt to read data from the server "mail.mydomain.com" failed.
    However, Mail seems to send and receive okay with the alerts popping up and so I'm not sure if this alert is anything to be serioulsy concerned about. Or, is there a way to fix this?

    I set mail to fetch messages every 15 minutes where I delayed one laptop in opening up mail initially by 5 minutes. That way, both laptops are not fetching mail concurrently and there's a gap of time for them to download mail before the other starts. This seemed to have fix this alert issue and I'm no longer getting these messages.
    Although, 15 minutes seems to be a bit long for auto fetching since my email can be under some time constraints. Does anyone know how to set the time to check every 10 minutes which I can probably live with? Currently, I have the option to set for 1 minute, 5 minutes, 15 minutes, 30 minutes, 1 hour, or manually.

  • Too many connections to call SAP functions

    Hello everyone,
    I'm having a random problem while accessing SAP functions on my applications.
    Sometimes i get this message:
    Could not create JCOClientConnection for logical Systems: WD_MODELDATA_DEST - Model: class com.xxx.sap.NameController.
    Please assure that you have configured the RFC connections and/or logical system name properly for this model.
    A friend tells me that this has to do with the fact that i use one model per SAP function ,
    and a custom controller for each unique model.
    This creates too many connections and launches the error.
    Can anyone tell me how to solve this problem without
    having to reimport all my functions into one single model  and one single custom controller ??
    My biggest problem is that doing that would increase the time spent on project development dramatically.
             Thank you everyone,
                  Nuno Santos

    Hi Guillaume,
    My answers:
    1. All connections are closed by time-out, but i would really apreciate if someone could explain how to explicitly close them after calling them.
    2. No. That is the big problem. This was my first project, and in a very simplistic (and stupid) way i created a webdynpro model for each SAP function that i call. This means that an application may call 5 or 6 functions during it's runtime, meaning 5 or 6 connections. Multiply this by a few hundred users...
    What are my choices here?
    Help will be really apreciated.
       Thanks to everyone,
           Nuno Santos

  • Error "421 #4.4.5 Too many connections from your host"

    We have deployed a Java application using JavaMail which enables people to send email to their contact lists. It has been in use for a few years, various updates being applied over that time. Most of our customers have no problem. But a couple of weeks ago, two of them suddenly could no longer send emails.
    The connection to the SMTP server works but when the application sends email, it gets an error 421. A debugging dump is reproduced below: the target email address is changed to protect the uninvolved; messages starting with **** come from my program, other come from JavaMail.
    Can anyone solve this problem? suggest where to look? Thanks.
    DEBUG SMTP: useEhlo true, useAuth true
    DEBUG SMTP: trying to connect to host "smtp10.bellnet.ca", port 25, isSSL false
    220 toip35-bus.srvr.bell.ca ESMTP
    DEBUG SMTP: connected to host "smtp10.bellnet.ca", port: 25
    EHLO Communications
    250-toip35-bus.srvr.bell.ca
    250-8BITMIME
    250 SIZE 20971520
    DEBUG SMTP: Found extension "8BITMIME", arg ""
    DEBUG SMTP: Found extension "SIZE", arg "20971520"
    **** transport connect worked
    NOOP
    250 ok
    **** about to send message to [email protected]
    NOOP
    250 ok
    DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
    DEBUG SMTP: useEhlo true, useAuth true
    **** cEmailAuthenticator.getPasswordAuthentication() called
    DEBUG SMTP: useEhlo true, useAuth true
    DEBUG SMTP: trying to connect to host "smtp10.bellnet.ca", port 25, isSSL false
    421 #4.4.5 Too many connections from your host.
    DEBUG SMTP: could not connect to host "smtp10.bellnet.ca", port: 25, response: 4

    Looks like the server keeps track of the number of connections from each machine, and when the number of connections in a certain period exceeds some number, that machine is deemed to be a potential spammer. At any rate it is something you should discuss with the manager of that server.

  • Why Customer get too many "Connection reset by peer"

    Hi,
    I have CSS 11503 V7.50 without SSL Module.
    I have 4 real servers and LB method is Round Robin. Customer tests the methods by using two way.
    First A requestor try to connect service via VIP address.Second requestor try to connect to real servers by using directly real server IP address (Bypass Load balacer)
    Customer cheks the real server logs and sees that in first experiment (via VIP) there too many "connection reset by peer" messages. For second experiment there are few same messages.
    I wonder why real servers get this messages. Plus, why CSS reset flows. I know flow timeout does that. But if there are too many idle flows, it says something wrong?

    There is a command, but I was more thinking about the server side counter or log info.
    If you really want to see if the CSS sent a RESET or not, you can use the following engineering command
    CSS11503-2(debug)# symbol-table load SPRITZ
    Loading string table... 660,706
    Loading symbols........ 24,937
    Load complete.......... 1,259,194
    CSS11503-2(debug)# shell 1 1 FMShowReset
    FM RESET COUNTERS:
    Last FM Reset Case was 7
    0 Case 1: Server Flow not in WCC
    0 Case 2: Client Flow not in WCC
    0 Case 3: FM_ContentHandleUnexpectedTermination
    0 Case 4: Server not responding on backend, reset client
    0 Case 5: Server not responding on backend, reset server
    0 Case 6: WCC returns empty vector, reset client
    18 Case 7: Reset to server on DOS attack
    2 Case 8: FM_HandleEarlySpoofTermination
    0 Case 9: Reset client if join fails in spoof flow
    0 Case 10: TCP SYN Exceeded
    0 Case 11: Reset server on remap backend connection
    0 Case 12: WCC did not return WCC_TCP_SPOOF for FAUX SYN
    0 Case 13: FM_HandleFinalClose
    0 Case 14: FM_CreateRedirectServerReset
    0 Case 15: Flow reset, route change
    0 Case 16: Peer reset, route change
    0 Case 17: Peer Flow rejected, either WCC rejected or no egress port
    0 Case 18: Reset flow, bridge forwarding change
    0 Case 19: Reset flow, egress port went down
    0 Case 20: Client side connection reset sent
    0 Case 21: Server side connection reset sent
    0 Case 22: Reset client due to server reset
    0 Case 23: Received ACK to SYN, reset existing connection on server
    0 Case 24: Server side reset, server port down
    0 Case 25: Client side reset, client port down
    0 Case 26: Server side reset, client port down
    0 Case 27: Client side reset, server port down
    0 Case 28: MIDNAT reject, reset server
    0 Case 29: MIDNAT reject, reset client
    0 Case 30: FM_HandleTcpResetVipUnavailable
    0 Case 31: MID SPOOF reject, reset server
    0 Case 32: MID SPOOF reject, reset client
    Gilles.

  • IPhones w ActiveSync creating too many connections on mail server

    Over the past two days, I have started getting 503 errors, indicating too many connections. When I went to look at active connections, I noticed that the vast majority were from the iPhones that connect using ActiveSync. Just in the 45 minutes since I cleared all active connections, my iPhone has created 14 active connections. When you multiply that by the eight iPhones we have at this company the number jumps to 112. It is easy to see why the 503 error is getting generated by the end of the business day. It is as though the iPhone is unable to let go of an active connection, and just starts a new one. This only seems to be happening since the iPhone 3.0 update. Is anyone else experiencing similar issues?

    Yes - I'm having a very similar problem on our server. But in this case the user has a very large mailbox - and imap processes are spawned but never die unless I go in and manually kill them.

  • Too many connections!what can i do?help :)

    Hello,everyone!
    I am a programmer in China,I like java,During working I met a question,please give me some indicate!
    //the main program
    public void actionPerformed(ActionEvent e){
    mysqldatabean mysqldata=new mysqldatabean();
    String sql1="select*from talbe1";
    ResultSet rs1=mysqldata.mysqlexecuteQuery(sql1);
    try{
    while(rs1.next()){
    String id=rs1.getString("id");
    String sql2="select*from table2 where id='"+id+"'";
    ResultSet rs2=mysqldata.mysqlexecuteQuery(sql2);
    try{
    while(){
    catch(SQLException ex){}
    mysqldata.destroyconnection();
    catch(Exception ex){}
    mysqldata.destroyconnection();
    //the class
    class mysqldatabean {
    String mysqlDBDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
    String mysqlConnStr = "jdbc:odbc:mysqldata";
    Connection mysqlconn = null;
    ResultSet mysqlrs = null;
    Statement mysqlstmt=null;
    public mysqldatabean() {
    try {
    Class.forName(mysqlDBDriver);
    catch(java.lang.ClassNotFoundException e) {
    System.err.println("mysqlexecuteQuery: " + e.getMessage());
    public ResultSet mysqlexecuteQuery(String mysqlsql) {
    try {
    mysqlconn = DriverManager.getConnection(mysqlConnStr);
    mysqlstmt = mysqlconn.createStatement();
    mysqlrs = mysqlstmt.executeQuery(mysqlsql);
    catch(SQLException ex) {
    System.err.println("mysqlexecuteQuery: " + ex.getMessage());
    return mysqlrs;
    public void destroyconnection(){
    boolean connboolean=false;
    try{
    mysqlconn.close();
    connboolean=mysqlconn.isClosed();
    catch(SQLException ex){}
    Question:
    because of large number of datas,while execute,Exception:mysql server, odbcdriver too many connections, getSQLState:s1000
    how can i change this program?please give me the anwser(code),I need it immediately!
    Help!!:)
    [email protected]

    // You are trying to establish connection for all statements.
    // You only need connection per database connection not per statement.
    // Try to create connection outside of mysqlexecuteQuery()
    mysqldatabean mysqldata=new mysqldatabean();
    String sql1="select*from talbe1";
    mysqlconn = DriverManager.getConnection(mysqlConnStr);
    ResultSet rs1=mysqldata.mysqlexecuteQuery(sql1);
    public ResultSet mysqlexecuteQuery(String mysqlsql) {
    try {
    mysqlstmt = mysqlconn.createStatement();
    mysqlrs = mysqlstmt.executeQuery(mysqlsql);
    catch(SQLException ex) {
    System.err.println("mysqlexecuteQuery: " + ex.getMessage());
    return mysqlrs;

  • SMTP connection refused too many connections

    I keep getting the above error on my email.
    I'm using blue iris to send me emails using my bt account and over the last month I'm am getting more and more SMTP failed to connect, when is look at the logs on blue iris it says connection refused too many active connections.
    Can anyone tell me if BT has a limit on the number of active connections to my btinternet.com email?

    Hi ChrisBRRS,
    Welcome and thanks for posting.
    I'm sorry for the problems you're having.  I've moved your post here where it's more relevant and others should be along now to offer further advice 
    All the best,
    Robbie
    BTCare Community Mod
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry that we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)
    If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

  • Safari with IIS: Too many connections?

    Has anyone out there any experience using Safari with Microsoft's IIS? In particular, the 'Personal Edition' of IIS that only allows 10 concurrent connections?
    I'm finding that whenever I access one of the websites running on IIS using Safari, I can only click through a limited number of pages before I get an error message from the IIS server: "Too many people are trying to connect to this server."
    It's almost as if Safari is treating each request as a new connection. I don't have this problem running Firefox or IE. Come to think of it, I never had this problem before Tiger!
    I'm using a PC running IIS as a testing server for my ASP-based websites.
    Any ideas ... anyone? :o)
    Kind regards,
    Oli Trenouth
    Media Developer

    This is a bit sad -- I'm answering my own post :o)
    In case anyone is interested, I think I may have found a workaround. Aparently the problem is related to the HTTP Keep-alive request. I guess Safari is trying to keep to many connection alive, and running up a bill on the server.
    One way around this is to turn off the Keep-Alive setting within IIS, however this causes problems if you're using authentication on your site. The alternative is reduce the session timeout to something small, such as 5 or 10 seconds.
    Luckily my site doesn't rely on session states, so I'm ok there!
    I guess the real solution is to get a proper webserver
    If anyone has any better suggestions, I welcome your comments.
    Many thanks,
    Once again,
    Oli Trenouth.

  • UserTransaction and too many connections

    This might sound a bit weird. I am just looking for some quick pointers here if possible. The OC4J version in use is 9.0.4.0.0. I am doing something along the following lines in a struts action class.
    1) UserTransaction txn = ctx.lookup("java:comp/UserTransaction");
    2) Connection conn = dataSource.getConnection();
    3) txn.begin();
    4) ..StatelessSessionBean call which uses a few entity beans (Bean Managed)
    5) Direct updates using conn (no commits in this).
    6) txn.commit
    My issue is with step 4 above. It does some updates and this results in close to 500 plus physical db connections getting created when in UserTransaction. The beans are normal usual beans and the whole process works without issues if I get rid of UserTransaction with less than 50 physical connections.
    I am just not able to pinpoint what exactly might be going wrong in the beans that such a large number of connections get created when in UserTransaction.
    The datasource is along these lines
         &lt;data-source
              class="com.evermind.sql.DriverManagerDataSource"
              name="xxxDB"
              location="jdbc/xxxDBCore"
              pooled-location="jdbc/xxxDBCore_non_tx"
              xa-location="jdbc/xa/xxxDBXA"
              ejb-location="jdbc/xxxDB"
              connection-driver="oracle.jdbc.driver.OracleDriver"
              username="xxxxxxxx"
              password="xxxxxxxx"
              url="jdbc:oracle:thin:@1.2.3.4:1521:xxx"
              min-connections="10"
         /&gt;
    I check for the number of physical connections using the oc4j option
    -Ddatasource.verbose=true which prints out the information.
    If I set the max-connections attribute on the datasource, I get a Timeout waiting for connection exception in the app.
    If any of this rings a bell and if you have any thoughts or suggestions, I would really appreciate it.
    Thanks in advance
    best regards
    -Sudhir

    Just to add to my above post, the messages on the cnsole are along the lines of ...
    null: Connection com.evermind.sql.DriverManagerXAConnection@189c9fe allocated (Pool size: 0)
    Created new physical connection: com.evermind.sql.DriverManagerXAConnection@12c820f
    null: Connection com.evermind.sql.DriverManagerXAConnection@12c820f allocated (Pool size: 0)
    Created new physical connection: com.evermind.sql.DriverManagerXAConnection@10eb09e
    null: Connection com.evermind.sql.DriverManagerXAConnection@10eb09e allocated (Pool size: 0)
    Created new physical connection: com.evermind.sql.DriverManagerXAConnection@16d7d9e
    null: Connection com.evermind.sql.DriverManagerXAConnection@16d7d9e allocated (Pool size: 0)
    Created new physical connection: com.evermind.sql.DriverManagerXAConnection@e3f9e3
    null: Connection com.evermind.sql.DriverManagerXAConnection@e3f9e3 allocated (Pool size: 0)
    Created new physical connection: com.evermind.sql.DriverManagerXAConnection@10382ca
    null: Connection com.evermind.sql.DriverManagerXAConnection@10382ca allocated (Pool size: 0)
    Created new physical connection: com.evermind.sql.DriverManagerXAConnection@17faec2
    Why would the pool size be 0?

  • Too many open socket connections causing ColdFusion to crash?

    I’m currently working on an e-commerce site which sends and receives information to/from the client’s order management system via XML over a TCP/IP socket.  It uses a very old java-based custom tag called CFX_JSOCKET (which appears to have been written in 2002) to open the socket, send the data, and get the response.  The code that calls the custom tag and sends/receives data from the OMS pre-dates my working on the site, but its always worked, so I haven’t paid it much attention.
    Back in the summer of 2009 we started experiencing issues with ColdFusion (v.7 on Window 2003 at the time) locking up on a more and more frequent basis, until it ultimately became a daily issue.  After extensive research we narrowed the issue down to the communication between the web server and our client’s order management server.  It seemed the issue with ColdFusion hanging was either related to there being too many connections open, or to these connections hanging and resulting in dead threads.  This an educated guess based on a blog post I’d seen online, not actual monitoring of either CF or the TCP/IP connections.  As soon as we dialed back the timeout on the CFX_JSOCKET tag from 20 seconds to 10, the issue disappeared, so we left it at that and moved on.
    Fast forward to this January. The site is hosted at a new location, on a 64-bit Windows 2008 box running ColdFusion 9.  Over the years traffic on the site has continued to grow.  The nature of the clients business means that August and January are their business times of the year (back to school for college kids) and in January ColdFusion once again started locking up on an almost-daily basis.  
    One significant difference is that the address cleansing software that previously ran on the box and was used to verify shipping addresses is not available for 64-bit, so when we moved to the new server last summer, that task was moved to the client’s order management software and handled via XML like all other interaction with that system. However, while most XML calls to that server (order input, inventory check, etc) take under a second to complete, the address cleansing call regularly takes over 5 seconds to return data, and frequently times out. 
    Once we eliminated the address cleansing call from the checkout process, ColdFusion once again stopped locking up regularly.  So it appears that once again it’s the communication between the web server and the order management server that’s causing problems. We currently have that address cleansing call disabled on the web site in order to keep ColdFusion from crashing, but that’s not a long term solution.
    We don’t have, nor can I find online, the source code for the CFX_JSOCKET custom tag, so I decided I’d write some CF code utilizing the java methods to open the socket, send the data, get the response, and close the connection.  My test code is working fine (under no load).  However, in trying to troubleshoot an issue I had with it, I started monitoring the TCP/IP connections using TCPView.  And I noticed that all the connections to the order management server, whether opened via the custom tag or my new code, remain open in either a TIME_WAIT or FIN_WAIT2 status for well over 2 minutes, even though I know for a fact that my new code is definitely closing the connection from the web server side. 
    They do all close eventually, but I’m wondering 1. Why they’re remaining open that long; 2. Is that normal; and 3. If all these connections remaining open could be what’s causing ColdFusion to choke. 
    Does this sound plausible?  If so, does anyone have any suggestions/recommendations about how to fix it?  My research seems to indicate this might be a matter of the order management system not closing the connection on its end, but I’m in way over my head, and before I go to client and tell them it’s their OMS causing the issue, I need to feel a little more confident that I’m on the right track. 
    Any help or advice would be very greatly appreciated.  And thanks for taking the time to read through my long-winded explanation of the problem.
    Set-up details:
    ColdFusion Version: 9,0,0,251028  Standard 
    Operating System: Windows Server 2008 
    Java Version: 1.6.0_14 
    Java VM Name: Java HotSpot(TM) 64-Bit Server VM 
    Java VM Version: 14.0-b16 
    Thanks,
    Laurie

    Hi Laurie,
    Not aware of custom tag called CFX_JSOCKET. I guess the process you described very well is consuming a resource then you are getting a problem. Trick is what parameter to adjust. Perhaps you are running out of one the threads in CFadmin > Server Settings > Request Tuning.
    I expect if you enable CF Metrics logging where you can log the threads and other resources then you can find out which parameter needs adjusting. Let me know if you want some details on enabling CF Metrics. Perhaps others will have much better idea than me and help without the overhead of logging.
    The other interesting thing is you are using CF9.0.0. Do you have some reasons for not being on updater1 CF9.0.1?
    HTH, Carl.
    PS I posted before however seems to have gone, just hope does not come back and then I have posted twice.

Maybe you are looking for