php-general Digest 29 Nov 2010 23:54:35 -0000 Issue 7061
Topics (messages 309743 through 309754):
Re: Disk IO performance
309743 by: Per Jessen
309744 by: Daniel Molina Wegener
Poor newsgroup server performance
309745 by: Al
309746 by: Daniel P. Brown
309747 by: Al
309748 by: Daniel Brown
309749 by: Steve Staples
EE1 plugin code/htmlentities() question
309750 by: Micky Hulse
mySQL query assistance...
309751 by: Don Wieland
309752 by: Daniel P. Brown
309753 by: Daniel P. Brown
Form Processing
309754 by: Ron Piggott
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Daniel Molina Wegener wrote:
> On Sunday 28 November 2010,
> Larry Garfield <[email protected]> wrote:
>
>> There are many things that everybody "knows" about optimizing PHP
>> code. One of them is that one of the most expensive parts of the
>> process is loading code off of disk and compiling it, which is why
>> opcode caches
>> are such a bit performance boost. The corollary to that, of course,
>> is that more files = more IO and therefore more of a performance hit.
>
> It depends on the implementation that PHP uses to open the file. For
> example on Linux and similar operating systems, PHP uses the mmap(2)
> function instead of read(2) or fread(2) functions, so it maps the
> complete file into memory, that is more faster than using partial file
> reads.
I doubt if a read(file,1Mb) and an mmap(file,1Mb) will be very
different. The file has got to be hauled in from disk regardless of
which function you choose.
--
Per Jessen, Zürich (2.6°C)
--- End Message ---
--- Begin Message ---
On Monday 29 November 2010,
Per Jessen <[email protected]> wrote:
> Daniel Molina Wegener wrote:
> > On Sunday 28 November 2010,
> >
> > Larry Garfield <[email protected]> wrote:
> >> There are many things that everybody "knows" about optimizing PHP
> >> code. One of them is that one of the most expensive parts of the
> >> process is loading code off of disk and compiling it, which is why
> >> opcode caches
> >> are such a bit performance boost. The corollary to that, of course,
> >> is that more files = more IO and therefore more of a performance hit.
> >>
> > It depends on the implementation that PHP uses to open the file. For
> >
> > example on Linux and similar operating systems, PHP uses the mmap(2)
> > function instead of read(2) or fread(2) functions, so it maps the
> > complete file into memory, that is more faster than using partial file
> > reads.
>
> I doubt if a read(file,1Mb) and an mmap(file,1Mb) will be very
> different. The file has got to be hauled in from disk regardless of
> which function you choose.
Well, they are different. That's why some php functions and a wide
variety of language implementations are using mmap(2) instead of read(2)
to read files from the hard drive for inclusion or module importing.
Also Apache uses sendfile(2) and mmap(2) when they are available on
the platform because are more faster than read(2).
You just can trace how php loads certain modules when you call
include(), require(), include_once() and require_once(). Also Python,
Perl and other languages have a similar implementation when they
are loading modules.
read(2) depends on the VFS blocksize, which is used as the maximum
unit for chunk reads, mmap(2) not.
Just check the PHP source code or run an strace(1) over php loading
modules and check which function is used to read inclusions.
Best regards,
--
Daniel Molina Wegener <dmw [at] coder [dot] cl>
System Programmer & Web Developer
Phone: +56 (2) 979-0277 | Blog: http://coder.cl/
signature.asc
Description: This is a digitally signed message part.
--- End Message ---
--- Begin Message ---
Recently the response on our php.general php.pear.general have become horribly
slow.
At first I thought the problem was a time-of-day overload; but, it seems to be
happening at all times.
All other websites I visit are normal.
Just getting to post this message took 2 timeouts.
--- End Message ---
--- Begin Message ---
On Mon, Nov 29, 2010 at 09:14, Al <[email protected]> wrote:
> Recently the response on our php.general php.pear.general have become
> horribly slow.
>
> At first I thought the problem was a time-of-day overload; but, it seems to
> be happening at all times.
>
> All other websites I visit are normal.
>
> Just getting to post this message took 2 timeouts.
Via what news server(s), Al?
--
</Daniel P. Brown>
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/
--- End Message ---
--- Begin Message ---
On 11/29/2010 11:03 AM, Daniel P. Brown wrote:
On Mon, Nov 29, 2010 at 09:14, Al<[email protected]> wrote:
Recently the response on our php.general php.pear.general have become
horribly slow.
At first I thought the problem was a time-of-day overload; but, it seems to
be happening at all times.
All other websites I visit are normal.
Just getting to post this message took 2 timeouts.
Via what news server(s), Al?
news.php.net
--- End Message ---
--- Begin Message ---
On Mon, Nov 29, 2010 at 12:52, Al <[email protected]> wrote:
> On 11/29/2010 11:03 AM, Daniel P. Brown wrote:
>>
>> Via what news server(s), Al?
>>
>
> news.php.net
Okay, figured as much. I had mentioned some time ago that I would
look into adding an NNTP-only mirror of news.php.net because of those
issues, so I'll get to work on that this week. I'm working to revamp
some of the php.net infrastructure as it is, so that won't be too much
additional work.
(Famous last words....)
--
</Daniel P. Brown>
Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/
--- End Message ---
--- Begin Message ---
On Mon, 2010-11-29 at 13:01 -0500, Daniel Brown wrote:
> On Mon, Nov 29, 2010 at 12:52, Al <[email protected]> wrote:
> > On 11/29/2010 11:03 AM, Daniel P. Brown wrote:
> >>
> >> Via what news server(s), Al?
> >>
> >
> > news.php.net
>
> Okay, figured as much. I had mentioned some time ago that I would
> look into adding an NNTP-only mirror of news.php.net because of those
> issues, so I'll get to work on that this week. I'm working to revamp
> some of the php.net infrastructure as it is, so that won't be too much
> additional work.
>
> (Famous last words....)
>
> --
> </Daniel P. Brown>
> Network Infrastructure Manager
> Documentation, Webmaster Teams
> http://www.php.net/
>
i remember telling a client that.. oh yeah, you're just moving cpanel
accounts to a new cpanel server... shoulnd't take more than a few hours
to copy it over, and dns to propagate.. 36 hours later, and no
sleep... i got it done... barely in time for his clients to log back in
at 8am... that was a stressful weekend...
steve
--- End Message ---
--- Begin Message ---
Hello,
I was looking at this ExpressionEngine plugin:
<http://expressionengine.com/downloads/details/xml_encode/>
Description: This plugin converts reserved XML characters to entities.
It is used in the RSS templates.
... Curious about this code:
trim(str_replace(array('/', ' '), array("/", ' '), $str));
The plugin author used the above bit of code in the return statement.
Just curious if their is any particular reason why one would want to
replace / and with / and   respectively?
For example, I am writing a similar plugin which utilizes
htmlentities()... I guess I am just wondering if I should apply the
same code as above to my entity-converted string?
Thoughts?
Thanks!
Micky
--- End Message ---
--- Begin Message ---
Hi all,
Is there a list/form to get some help on compiling mySQL queries? I am
executing them via PHP, but do not want to ask for help here if it is
no the appropriate forum. Thanks ;-)
Don
--- End Message ---
--- Begin Message ---
On Mon, Nov 29, 2010 at 14:35, Don Wieland <[email protected]> wrote:
> Hi all,
>
> Is there a list/form to get some help on compiling mySQL queries? I am
> executing them via PHP, but do not want to ask for help here if it is no the
> appropriate forum. Thanks ;-)
Yes.
For MySQL queries, write to the MySQL General list at
[email protected]. For PHP-specific database questions (for any
database backend, not strictly MySQL), such as problems in connecting
to the database, questions on support for database platform/version,
or even query processing, you should use [email protected].
For your convenience, both have been CC'd on this email.
--
</Daniel P. Brown>
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/
--- End Message ---
--- Begin Message ---
On Mon, Nov 29, 2010 at 14:40, Daniel P. Brown
<[email protected]> wrote:
> For your convenience, both have been CC'd on this email.
Actually, PHP-DB ([email protected]) was accidentally BCC'd.
--
</Daniel P. Brown>
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/
--- End Message ---
--- Begin Message ---
I am unable to retrieve the value of $referral_1 from:
$new_email = mysql_escape_string ( $_POST['referral_$i'] );
why?
PHP while lopp to check if any of the fields were populated:
$i=1;
while ( $i <= 5 ) {
$new_email = mysql_escape_string ( $_POST['referral_$i'] );
if ( strlen ( $new_email ) > 0 ) {
....
}
}
The form itself:
<form method="post" action=”website”>
<p style="margin: 10px 50px 10px 50px;"><input type="text" name="email"
maxlength="60" class="referral_1" style="width: 400px;"></p>
<p style="margin: 10px 50px 10px 50px;"><input type="text" name="email"
maxlength="60" class="referral_2" style="width: 400px;"></p>
<p style="margin: 10px 50px 10px 50px;"><input type="text" name="email"
maxlength="60" class="referral_3" style="width: 400px;"></p>
<p style="margin: 10px 50px 10px 50px;"><input type="text" name="email"
maxlength="60" class="referral_4" style="width: 400px;"></p>
<p style="margin: 10px 50px 10px 50px;"><input type="text" name="email"
maxlength="60" class="referral_5" style="width: 400px;"></p>
<p style="margin: 10px 50px 10px 50px;"><input type="submit" name="submit"
value="Add New Referrals"></p>
</form>
What am I doing wrong?
Ron
The Verse of the Day
“Encouragement from God’s Word”
http://www.TheVerseOfTheDay.info
--- End Message ---