Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #11747

Re: Mysqli or PDO Persistent prepared statements

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Arno Welzel <usenet@arnowelzel.de>
Newsgroups comp.lang.php
Subject Re: Mysqli or PDO Persistent prepared statements
Date Wed, 06 Nov 2013 21:04:00 +0100
Lines 31
Message-ID <527AA0B0.3010001@arnowelzel.de> (permalink)
References <fab413de-c3eb-43c9-87e0-dc725e1cb5b6@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-Trace individual.net PWyYgJxprwq17JP82NiDYQxD4WtFPAOC9r4Z77J3y5A3z1tP0c
Cancel-Lock sha1:ruUQH7Qzms1VIbF++HWAIP2vx08=
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0
In-Reply-To <fab413de-c3eb-43c9-87e0-dc725e1cb5b6@googlegroups.com>
X-Enigmail-Version 1.6
Xref csiph.com comp.lang.php:11747

Show key headers only | View raw


Ram, 2013-11-06 10:18:

> I have a very high traffic server. Getting upto a million hits per day. 
> These are basically tracking URLs that log the hits and redirect to the relevant page
> 
> The current script using php mysql is very slow. I want to switch to mysqli. 
> Are there any basic guidelines for shifting to mysqli 
> Can I use a persistent prepared statements across different calls to the web server ? 

Besides all other tips: Consider using a byte code cache (XCache, APC
etc.) as well and also check if not the database itself is the bottleneck.

A million hits per day may be up to 10 hits per second - and if really
*every* hit results in a database operation it may not just the small
difference between mysql, msqli or PDO which is important here.

Also check your application in a test environment and load/stress
testing tools (ApacheBench, Gatling Curl-loader etc.) to see how your
scripts perform.

Maybe using other techniques may be better - e.g. using a kind of
"cache" for the redirects which can be loaded and used without any
database access at all. If you need to track hits as well it may be
easier to keep process access logs in text form and process them using a
cron job in background and maybe even on another server.


-- 
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de

Back to comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Mysqli or PDO Persistent prepared statements Ram <ramprasad.ap@gmail.com> - 2013-11-06 01:18 -0800
  Re: Mysqli or PDO Persistent prepared statements The Natural Philosopher <tnp@invalid.invalid> - 2013-11-06 09:46 +0000
  Re: Mysqli or PDO Persistent prepared statements Jerry Stuckle <jstucklex@attglobal.net> - 2013-11-06 05:45 -0500
  Re: Mysqli or PDO Persistent prepared statements Tobiah <toby@tobiah.org> - 2013-11-06 09:41 -0800
  Re: Mysqli or PDO Persistent prepared statements Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-11-06 20:25 +0100
    Re: Mysqli or PDO Persistent prepared statements "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2013-11-06 22:06 +0000
  Re: Mysqli or PDO Persistent prepared statements Arno Welzel <usenet@arnowelzel.de> - 2013-11-06 21:04 +0100

csiph-web