Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Arno Welzel Newsgroups: comp.lang.php Subject: Re: PHP boilerplate to appear at the top of any program Date: Tue, 5 Jan 2016 04:19:56 +0100 Lines: 96 Message-ID: <568B365C.6080100@arnowelzel.de> References: <568AE9F9.5010506@arnowelzel.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: individual.net sK+x3c8TceikDUOQSoU1EQsahjr1cvicaNHd4icTTqSy1PyYMk Cancel-Lock: sha1:W5oNrXBQQ/KEAN3dKcF5J8VGGe4= In-Reply-To: Xref: csiph.com comp.lang.php:16076 Jerry Stuckle unfriendly as usual: > On 1/4/2016 4:54 PM, Arno Welzel wrote: >> Jerry Stuckle schrieb am 2016-01-04 um 20:41: >> >>> On 1/4/2016 1:42 PM, Daniel Pitts wrote: >> [...] >>>> I doubt that. Though I don't doubt they have more bugs and are harder >>>> to maintain. >>> >>> You have no idea. They are easy to maintain and have few bugs because >>> they don't include all kinds of unnecessary stuff. And since they don't >>> include unnecessary stuff, they load more quickly. >>> >>> Try coding for a site which gets up to 1K page views per second, for >>> instance. You aren't going to get that with Symfony2 or any other >>> framework. >> >> I did some tests. >> >> The machine: Xeon E3-1231 with 32 GB RAM und 2x512 GB SSD (Samsung Pro >> 850) as RAID 1. Apache uses PHP as a module and at the time of testing >> no one else is accessing the machine. >> >> Apache bench with the following command line: >> >> ab -n 10000 -c 100 http://server.example/script.php >> > > ab does not do page views. It does hits only. It does not retrieve > linked URIs or process javascript. Yep - so the number of page views will definitely be even *lower*, not higher. To get an impression how fast (or slow) a server is, this is still a good estimation - and YOU KNOW THIS! >> First a really simple script - which results in about 12000 requests per >> second: >> >> > echo "Hello World"; >> ?> >> >> Now with a simple database connection - just opening a MySQL connection >> and closing it again: >> > > Wow. You can do a hello world script! It's just an example. >> > $link = mysqli_connect("localhost", "user", "password"); >> if($link) >> { >> echo "OK"; >> mysqli_close($link); >> } >> ?> >> > > And even connect to a database! It's just an example. >> The same benchmark now only reports less than 500(!) requests per >> second. And yes - the MySQL database runs quite fine. But the overhead >> of opening and closing the connection all the time really hurts the >> performance as it takes at least 1-2 ms just for that. >> >> >> > > Now how about *REAL* pages. But you just proved you can't do them. You know the word of the meaning "example" or "really simple script"? > You're just trolling. I want to help others with *examples* what can affect the speed of PHP scripts. Some readers may also notice that there is a benchmark tool with Apache (ab) they did not noticed yet. And do you call this trolling? -- Arno Welzel http://arnowelzel.de http://de-rec-fahrrad.de http://fahrradzukunft.de