Applications that leak connections

Ask a Question related to PostgreSQL / PGSQL, Design and Development.

  1. #1

    Default Re: Applications that leak connections

    you are perfectly right, fixing the source of the problem is the best way to
    fix this. i always make it a habit to close my connections as soon as i'm
    done with it. if foxpro won't do it for you, you have to manage your own
    resources, always a good practice for unmanaged applications.

    i suggest you parse your code for all lines that opens the connection and
    close it where it's not needed anymore.

    good luck.

    regards,


    On Thu, 03 Feb 2005 18:27:46 -0500, Paul Tillotson wrote
    > Does anyone have any useful info about dealing with applications
    > which "leak" connections, eventually causing "connection limit
    > exceeded for non superusers?"
    >
    > Obviously fixing the app is the best choice, but I have a feeling
    > that this is going to recur again and again since the app is poorly
    > maintained but still under active development (code base too large
    > for the developer assigned to it). The developer is likely to
    > accidentally cause connection leaks in the future.
    >
    > This problem is also very easy to cause because doing this:
    >
    > c = sqlconnect("database")
    > c = sqlconnect("database")
    >
    > Causes TWO connections to be made, and the first connection made is
    > now
    > (as far as I can see) impossible to close without closing the
    > application. The language (Visual Foxpro) does not garbage collect
    > connections and so any connection whose handle is lost still takes
    > up one of the slots.
    >
    > On the server side, I can detect this condition using ps -A or lsof;
    > but I have not thought of a good solution to use when this is
    > noticed. One possibility is to just shut down the database and
    > restart it when this happens. I did some research into finding out
    > if it was possible to break a specific TCP connection (this is linux
    > 2.6 kernel--platform specific tools/commands ok). For example,
    > could I use hping to break the connections?
    >
    > Does anyone know a safe way to shutdown just one backend (if it is
    > idle)?
    >
    > Another possibility that I can think of is per ip address connection
    > limits. How hard would that be?
    >
    > Paul Tillotson
    >
    > ---------------------------(end of broadcast)---------------------------
    > TIP 2: you can get off all lists at once with the unregister command
    >
    > (send "unregister YourEmailAddressHere" to
    > [email]majordomo@postgresql.org[/email])

    --
    Jonel Rienton
    [url]http://blogs.road14.com[/url]
    Software Developer, *nix Advocate


    ---------------------------(end of broadcast)---------------------------
    TIP 6: Have you searched our list archives?

    [url]http://archives.postgresql.org[/url]

    Jonel Rienton Guest

  2. Similar Questions and Discussions

    1. Running Java applications with CF applications
      Is anyone out there running both Java and CF apps on their CFMX 7 J2EE Enterprise Server? I was going to migrate the Java apps to CF7 to avoid a...
    2. Web Applications
      I am looking for a web application to maintain users, mailing lists, news, events, sending out news letters. Does anyone know of such a package? ...
    3. COM+ applications
      Hi all, i have an Application named WorldRecords in IIS Server. Sql Server 2000 as Database in another machine. As an administrator when i...
    4. PHP Applications
      I'm thinking of of writing a multi-platform business software package that would be accessed by the users web browser on a local intranet. I would...
    5. web applications versus. web portal applications
      I came across a new term "web portal applications." Anyone can tell me what's the differences between web portal applications versus traditional...
  3. #2

    Default Re: Applications that leak connections

    Paul Tillotson wrote:
    > Does anyone know a safe way to shutdown just one backend
    Sending it a SIGTERM via kill(1) should be safe.

    -Neil

    ---------------------------(end of broadcast)---------------------------
    TIP 3: if posting/reading through Usenet, please send an appropriate
    subscribe-nomail command to [email]majordomo@postgresql.org[/email] so that your
    message can get through to the mailing list cleanly

    Neil Conway Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139