473,549 Members | 2,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what are normal ways to scale up PHP's default settings for growing traffic?


PHP comes with certain defaults, set in php.ini. Among these, scripts
time out after 60 seconds, I think. The default memory limit for a
script is, I believe, 8 megs.

I assume that when people do large-scale sites with PHP they scale
these numbers up. If you have a content management system running every
aspect of a large corporate web site, including a database back end
that employees use for important, secret, protected information, then I
imagine there is quite a lot of processing that might be needed for
every request.

A limit that I run into all the time is the memory limit. If I get a
large amount of info back from the database, and then try to store the
return in an array, it is easy to go over the default 8 meg limit.

So is it normal to scale up the default numbers? If so, by how much?

Aug 15 '05 #1
2 1542
>PHP comes with certain defaults, set in php.ini. Among these, scripts
time out after 60 seconds, I think. The default memory limit for a
script is, I believe, 8 megs.

I assume that when people do large-scale sites with PHP they scale
these numbers up. If you have a content management system running every
aspect of a large corporate web site, including a database back end
that employees use for important, secret, protected information, then I
imagine there is quite a lot of processing that might be needed for
every request.
Just because the site is large doesn't mean more processing for
every request. Just because the site is small with only one user
doesn't mean it won't have huge result sets that won't fit in 8 meg
or do a bunch of crunching that will take an hour of CPU time. And
the CPU time limits don't apply to how much CPU time your database
queries use in the database process.
A limit that I run into all the time is the memory limit. If I get a
large amount of info back from the database, and then try to store the
return in an array, it is easy to go over the default 8 meg limit.
There's no way you can limit the result set further? (In MySQL,
if you want to paginate the output to, say, 10 items per page, the
LIMIT clause can be used to retrieve only those 10 items rather
than all of them, and then you only display the appropriate 10).
Of course, there are plenty of reasons you might need to see all
the data anyway. If it's not practical to limit the data retrieved,
then you need the memory, and I see nothing wrong setting the limit
higher.

Setting the CPU limit to very high numbers (e.g. 5 minutes and
upwards) when this is actually needed is likely to mean unsatisfied
users unless they are told (repeatedly) that it's normal for the
page to take a huge amount of time to display. Give them some
progress indication. Otherwise they keep aborting the request and
you'll have dozens of the same request running at once.
So is it normal to scale up the default numbers? If so, by how much?


Having a lot of users, a lot of requests per hour, and a lot of
pages is not much of a reason to up these limits. Having pages
that actually *NEED* the limits raised to function is a good reason
to raise the limits. The limits are essentially there to protect
against errors like infinite loops from dragging the whole site
down with it. Seat belts save lives but not if they are adjusted
so tight you can't breathe.

Gordon L. Burditt
Aug 15 '05 #2
lk******@geocit ies.com wrote:

PHP comes with certain defaults, set in php.ini. Among these, scripts
time out after 60 seconds, I think. The default memory limit for a
script is, I believe, 8 megs.
<snip>
So is it normal to scale up the default numbers? If so, by how much?


No. If you're trying to cope with more traffic, then increasing the
resources which can be used by each process, and the length of time it can
hold on to the processes can only *reduce* the volume of traffic it can
cope with.

If these limits are causing problems you need to look elsewhere for the
answer.

If you just want to process more traffic, then follow the standard recipes
for tuning your webserver, and install a PHP accelerator (Zend, IonCude,
Turck etc).

HTH

C.
Aug 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3069
by: Michael Appelmans | last post by:
I'm a php novice and am developing a shopping cart application for a client who is hosted on a unix server. The hosting service requires that each php file have #!/usr/local/bin/php at the top. When I test these pages on my developer Windows php installation I get errors because Windows does not recognize the bang command so it is passed on as...
121
9949
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode support IDEs are DreamWeaver 8 and Zend PHP Studio. DreamWeaver provides full support for Unicode. However, DreamWeaver is a web editor rather...
24
2755
by: Bob Alston | last post by:
Most of my Access database implementations have been fairly small in terms of data volume and number of concurrent users. So far I haven't had performance issues to worry about. <knock on wood> But I am curious about what techniques those of you who have done higher volume access implementations use to ensure high performance of the...
7
5974
by: MrNobody | last post by:
I was a Java developer so I'm used to using property files as a means to keep configuration settings for my apps. I'm wondering what options are there with ..NET? Some settings I want to include are like a root directory for a target program on the user's machine my app uses, which they would be prompted to supply at startup. Normally the...
14
1480
by: saunderl | last post by:
Hello Everyone, I'm a lead developer of a ASP.Net site. We have over 150 "applications" running at our site. Each application is a "Solution" in VS. When we roll to test and production, the main dlls are rolled to the sites single bin directory and the aspx, asmx etc files are rolled to various folders on the server. Now with ASP.Net...
8
12962
by: werner | last post by:
Hi! I don't want to use eval() in order to parse a user-supplied formula. What alternatives do I have? PHP has no standard functionality for tokenizing or parsing expressions in this regard. Here is a simple example: The user supplies the following formula in string format, "a = (6+10)/4", and the script needs to find out what the value...
39
3199
by: windandwaves | last post by:
Hi Folk I have to store up to eight boolean bits of information about an item in my database. e.g. with restaurant drive-through facility yellow windows
3
1416
by: alainpoint | last post by:
I know Google are using Python for testing purposes. But for the rest ? is it PHP or Java or .NET? Which technology is rendering the google main page? And of course th obvious question, why not Python? Alain
6
1391
by: Michael | last post by:
hey all, I'm wondering what tools and techniques people use to do stuff with PHP. yes yes, I know it depends. but in general, let's say you have a BIG project to complete, how would you do it? there are programmers that all they use is direct PHP, there are some people that use template engine and some database abstraction , there are...
0
7554
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7511
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7840
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5396
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3509
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1973
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1087
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.