Connection pooling in PHP?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • howachen@gmail.com

    Connection pooling in PHP?

    Hi,

    Is that when using pconnect to mysql, it is already mean connection
    pooling?

    thanks.

  • Jerry Stuckle

    #2
    Re: Connection pooling in PHP?

    howachen@gmail. com wrote:
    Hi,
    >
    Is that when using pconnect to mysql, it is already mean connection
    pooling?
    >
    thanks.
    >
    No. mysql_pconnect( ) is a persistent connection. These connections
    will be around as long as your web server is running and can be reused
    by different scripts. The number of connections is fixed.

    Pooling allows connections to be reused also. But the difference is
    smart pooling will dynamically adjust the size of the pool. For
    instance, if a connect request is issued and there is a free connection,
    that one is used. If none are free, a new one is acquired.

    When a the application closes a connection, the connection isn't
    released immediately. Instead, it can hang around for a while.
    Eventually unused connections will be released.

    Of course, this assumes one server and one userid/password. It's a
    little more complex if you use more than one server and/or
    userid/password, but the concept is the same.

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • howachen@gmail.com

      #3
      Re: Connection pooling in PHP?


      Jerry Stuckle 寫道:
      howachen@gmail. com wrote:
      Hi,

      Is that when using pconnect to mysql, it is already mean connection
      pooling?

      thanks.
      >
      No. mysql_pconnect( ) is a persistent connection. These connections
      will be around as long as your web server is running and can be reused
      by different scripts. The number of connections is fixed.
      >
      Pooling allows connections to be reused also. But the difference is
      smart pooling will dynamically adjust the size of the pool. For
      instance, if a connect request is issued and there is a free connection,
      that one is used. If none are free, a new one is acquired.
      >
      When a the application closes a connection, the connection isn't
      released immediately. Instead, it can hang around for a while.
      Eventually unused connections will be released.
      >
      Of course, this assumes one server and one userid/password. It's a
      little more complex if you use more than one server and/or
      userid/password, but the concept is the same.
      >
      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===
      sorry first... my google account has some problem, which can't find my
      posted article and thus I repost it today.

      back to the topic...


      currently which package/solutions is the most popular one for php
      connection pooling?

      Comment

      • Jerry Stuckle

        #4
        Re: Connection pooling in PHP?

        howachen@gmail. com wrote:
        Jerry Stuckle 寫道:
        >
        >
        >>howachen@gmai l.com wrote:
        >>
        >>>Hi,
        >>>
        >>>Is that when using pconnect to mysql, it is already mean connection
        >>>pooling?
        >>>
        >>>thanks.
        >>>
        >>
        >>No. mysql_pconnect( ) is a persistent connection. These connections
        >>will be around as long as your web server is running and can be reused
        >>by different scripts. The number of connections is fixed.
        >>
        >>Pooling allows connections to be reused also. But the difference is
        >>smart pooling will dynamically adjust the size of the pool. For
        >>instance, if a connect request is issued and there is a free connection,
        >>that one is used. If none are free, a new one is acquired.
        >>
        >>When a the application closes a connection, the connection isn't
        >>released immediately. Instead, it can hang around for a while.
        >>Eventually unused connections will be released.
        >>
        >>Of course, this assumes one server and one userid/password. It's a
        >>little more complex if you use more than one server and/or
        >>userid/password, but the concept is the same.
        >>
        >>--
        >>============= =====
        >>Remove the "x" from my email address
        >>Jerry Stuckle
        >>JDS Computer Training Corp.
        >>jstucklex@att global.net
        >>============= =====
        >
        >
        sorry first... my google account has some problem, which can't find my
        posted article and thus I repost it today.
        >
        back to the topic...
        >
        >
        currently which package/solutions is the most popular one for php
        connection pooling?
        >
        There really isn't one.

        Is there a problem you're trying to solve with the pooling? How do you
        know this is the problem?


        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        Working...