Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9180019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:56:41+00:00 2026-06-17T17:56:41+00:00

I need to try to understand how MySQL processes/connections work. I have googled and

  • 0

I need to try to understand how MySQL processes/connections work. I have googled and dont see anything in laymans terms so I’m asking here. Here is the situation.

Our host is giving us grief over “too many MySQL processes”. We are on a shared server. We are allowed .2 of the server mySQL processes – which they claim is 50 connections – and they say we are using .56.

From the technical support representative:

“Number of MySQL procs (average) – 0.59 meant that you were using
0.59% of the total MySQL connections available on the shared server. The acceptable value is 0.20 which is 50 connections. “

Here is what we are running:

Zen Cart:           1.5.1  35K products. Auto updating of 1-20
                           products every 10 hours via cron.  
PHP version         5.3.16  
MySQL version       5.1.62-cll  
Architecture        i686  
Operating system    linux 

We generally have about 5000 hits per day on the site and Google bot loves to visit even though I have the crawl rate set to minimum in Google webmaster tools.

I’m hoping someone can explain MySQL processes to me in terms of what this host is talking about. Every time I ask them I get an obfuscated answer that is vague and unclear. Is a new MySQL process created every time a visitor visits the site? That does not seem right.

According to the tech we were using 150 connections at that particular time.

EDIT:
here is the connection function in zencart

  function connect($zf_host, $zf_user, $zf_password, $zf_database, $zf_pconnect = 'false', $zp_real = false) {
$this->database = $zf_database;
$this->user = $zf_user;
$this->host = $zf_host;
$this->password = $zf_password;
$this->pConnect = $zf_pconnect;
$this->real = $zp_real;
if (!function_exists('mysql_connect')) die ('Call to undefined function: mysql_connect().  Please install the MySQL Connector for PHP');
$connectionRetry = 10;
while (!isset($this->link) || ($this->link == FALSE && $connectionRetry !=0) )
{
  $this->link = @mysql_connect($zf_host, $zf_user, $zf_password, true);
  $connectionRetry--;
}
if ($this->link) {
  if (@mysql_select_db($zf_database, $this->link)) {
    if (defined('DB_CHARSET') && version_compare(@mysql_get_server_info(), '4.1.0', '>=')) {
      @mysql_query("SET NAMES '" . DB_CHARSET . "'", $this->link);
      if (function_exists('mysql_set_charset')) {
        @mysql_set_charset(DB_CHARSET, $this->link);
      } else {
        @mysql_query("SET CHARACTER SET '" . DB_CHARSET . "'", $this->link);
      }
    }
    $this->db_connected = true;
    if (getenv('TZ') && !defined('DISABLE_MYSQL_TZ_SET')) @mysql_query("SET time_zone = '" . substr_replace(date("O"),":",-2,0) . "'", $this->link);
    return true;
  } else {
    $this->set_error(mysql_errno(),mysql_error(), $zp_real);
    return false;
  }
} else {
  $this->set_error(mysql_errno(),mysql_error(), $zp_real);
  return false;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:56:42+00:00Added an answer on June 17, 2026 at 5:56 pm

    I wonder if it is a problem with connection pooling. Try changing this line:

    $this->link = @mysql_connect($zf_host, $zf_user, $zf_password, true);
    

    to this:

    $this->link = @mysql_connect($zf_host, $zf_user, $zf_password);
    

    The manual is useful here – the forth parameter is false by default, but your code is forcing it to be true, which creates a new connection even if an existing one is already open (this is called connection pooling and saves creating new connections unnecessarily i.e. saves both time and memory).

    I would offer a caveat though: modifying core code in a third-party system always needs to be done carefully. There may be a reason for the behaviour they’ve chosen, though there’s not much in the way of comments to be able to tell. It may be worth asking a question via their support channels to see why it works this way, and whether they might consider changing it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to connect to mySQL with python. From what I understand you need
i need to try for the drop down with name of the month ,
I try to make a apps that need barcode scanner, i already can get
i try to program a LdapAuthentication and i need some help. First i need
I need to write a delegate function that can 'wrap' some while/try/catch code around
I try to use the domainpeople.com API and to do I need to use
I need to read the output from ffmpeg in order to even try the
I need the ability to run an arbitrary command when I try and commit
I need to sanitize article titles when (creative) users try to attract attention with
Hi I shall try to explain clearly what I need to be able to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.