FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Re: Windows binaries 64bit for PHP
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Windows binaries 64bit for PHP [message #178072 is a reply to message #178069] Fri, 11 May 2012 23:00 Go to previous messageGo to previous message
Michael Fesser is currently offline  Michael Fesser
Messages: 215
Registered: September 2010
Karma:
Senior Member
.oO(Jerry Stuckle)

> On 5/11/2012 3:53 PM, Michael Fesser wrote:
>> .oO(Jerry Stuckle)
>>
>>> On 5/11/2012 3:11 PM, Michael Fesser wrote:
>>>>
>>>> A little maybe, but I don't think it really matters. What much has the
>>>> server to do after it didn't find the requested resource? Deliver
>>>> another page or call a script. I can't think of much more, except maybe
>>>> a second log entry. The typical redirects from http://example.com/foo to
>>>> http://example.com/foo/, which are still seen on many sites, are much
>>>> more expensive.
>>>
>>> No, you don't get it. A 404 causes even more overhead - Apache has to
>>> detect the 404
>>
>> Happens all the time for every single resource.
>>
>
> Nope. A static page is served up immediately.

But the server always has to check if it's there. How else could he
deliver it?

And if a previous 404 causes an image file to be created - from that
time on it will also be "served up immediately". The overhead for that
single image happens exactly one time. That's nothing to worry about.

>> Which is defined in the server configuration.
>
> And has to be found in the configuration - not required when the
> resource is found.

The configuration is loaded before and the handlers are defined.
It's just one function call or another (more or less):

if (resourceIsFound()) {
sendResource();
} else {
sendErrorDocument();
}

>>> In this case it's a PHP file, so the PHP module has to be
>>> loaded and the environment initialized, etc.
>>
>> On a site using PHP the module is already there and ready to work.
>
> Maybe, maybe not. It depends on the server. But even if it is loaded,
> it still has to be attached to the thread or process, the environment
> initialized.

Like on every other PHP page.

>>> Then the PHP code needs to determine if it is even a request for an
>>> image, and if the image can be found and resized. If so, the code must
>>> resize the image and send it.
>>
>> That's the only additional work, once per image. So what?
>
> Completely unnecessary work, but ok if your site only has 200 hits per day.

The work has to be done either way.

If you have 100.000 images and get 100.000 hits a day, each one for a
different image, all the images are created on that single day and can
be served directly from that time on. Only the first requester of a
particular image might notice a little delay.

>>> That's a lot of overhead, especially when you know the images and the
>>> sizes you need ahead of time.
>>>
>>> It's fine if you're running 200 hits/day, but not in a busy server.
>>
>> After a short period of time all most requested images are there.
>> Creating another missing image every now and then won't bring a server
>> to its knees.
>
> Creating them once with a script means the images are there from the start.

Which also takes a lot of time and creates images which might not be
used at all.

In short: These are two totally different approaches, but both have
their uses and are reasonable. Doing it the "all-before-way" is OK, but
so is the "on-demand-way". There's absolutely nothing wrong about the
latter: The server load is almost the same, just spread across time.

Micha

--
http://mfesser.de/blickwinkel
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: is_dir true from cli, false from Apache
Next Topic: in_array performance in unsorted vs sorted array
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 21:34:01 GMT 2024

Total time taken to generate the page: 0.03628 seconds