/    Sign up×
Community /Pin to ProfileBookmark

Hi all,

Just a philosophical question…

At what size do you think a php script becomes too large? 10kb? 20kb? 50kb? What about 100kb?

CTB

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@ShrineDesignsFeb 13.2005 — i think it doesn't really matter the php scripts are parsed server side so there is no bandwidth consumed
Copy linkTweet thisAlerts:
@iamlucky13Feb 13.2005 — I don't think of my scripts in terms of filesize, but rather in runtime. This is going to have a far larger effect on the performance of your site, and a good time is relative to what the page is doing. For example, you might have a script that does nothing more than include a few 20 kB html files. The total size of the files being parse may then be 100 kB, but the run time should only be a millisecond or two. Some of my pages get most of their content from a database. Since database calls are a little slower than other processes and I'm not very good at optimizing, I have a goal of 20 ms on average. I read an article about how the Australian stock exchange upgraded their database servers and cut the time down of a script they run quite frequently to something like 15 seconds! That seems like forever in processing time, but they had a lot of data to handle.

Ultimately, the key issue is the server load created by your scripts and how many page requests it has to respond to. Having an idea what your runtime is can help you figure that out. In my case, I might guess that since it takes 20 ms on average, I could handle an average of 50 page requests per second. Of course, my time measurement is not very scientific, and there are quite a few other factors involved, but when I compare that capacity estimate to the number of visitors to my site, I know I'm good to go.

By the way, the index page on my site is 8.2 kB and runs in 5-10 ms when the script is cached.
×

Success!

Help @chestertb spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.11,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...