DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 17th August 2009
White White is offline
New User
 
Join Date: Aug 2009
Posts: 9
Thanked 0 Times in 0 Posts
Default Faster PHP

Hi every one,
I have server working under OpenBSD, but php scripts work sloww. If I would make /var/www/tmp folder in RAM, would it be any faster ?
Or is there any way to make it work faster ?
Reply With Quote
  #2   (View Single Post)  
Old 17th August 2009
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,876
Thanked 190 Times in 160 Posts
Default

Quote:
Originally Posted by White View Post
If I would make /var/www/tmp folder in RAM, would it be any faster ?
Maybe; maybe not. You have not characterized what the script is doing.

I would first suggest becoming familiar with the output of top(1) to ascertain whether the application is unduly chewing up CPU or swap space. top(1) will provide an indication whether adding RAM will help alleviate congestion.

In the same vane, study the output of swapctl(8) which will indicate how much the system is swapping out to swap space. Again, an inordinate amount indicates that the system is starved for RAM.

Next, study the output of iostat(8) & fstat(1) to determine the script is I/O-bound & whether the files in question reside in /var/www/tmp. Looking at the output of df(1) may provide additional context.

Effectively improving performance requires understanding multiple metrics. Without knowing more, moving /var/www/tmp to RAM may indeed make the situation worse.

Last edited by ocicat; 17th August 2009 at 10:01 AM.
Reply With Quote
  #3   (View Single Post)  
Old 17th August 2009
White White is offline
New User
 
Join Date: Aug 2009
Posts: 9
Thanked 0 Times in 0 Posts
Default

Quote:
You have not characterized what the script is doing.
It's a regular web forum script
Quote:
CPU or swap space.
Server dosen't use swap, there is 800 MB of RAM free.
CPU is 2.8 Ghz, Intel Pentium 4, usually it's almost not loaded at all.
Reply With Quote
  #4   (View Single Post)  
Old 17th August 2009
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default

How to make PHP scripts run faster?

Use C or ASM to do the leg work (like all of it :P)


beyond that, it's the same problem as always.... study, tune, tweak, test, ....
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #5   (View Single Post)  
Old 18th August 2009
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,067
Thanked 198 Times in 156 Posts
Default

Quote:
Originally Posted by White View Post
It's a regular web forum script
Does it use a database? First thing that comes to mind is that the database is the bottleneck.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #6   (View Single Post)  
Old 19th August 2009
White White is offline
New User
 
Join Date: Aug 2009
Posts: 9
Thanked 0 Times in 0 Posts
Default

Quote:
Does it use a database? First thing that comes to mind is that the database is the bottleneck.
Yes, it does.
I have worked on my.cnf a bit, so I don't think it's that ... =\
Reply With Quote
  #7   (View Single Post)  
Old 19th August 2009
s2scott's Avatar
s2scott s2scott is offline
Package Pilot
 
Join Date: May 2008
Location: Toronto, Ontario Canada
Posts: 198
Thanked 9 Times in 8 Posts
Default

Quote:
Originally Posted by ocicat View Post
... I would first suggest ... top(1) ... swapctl(8) ... iostat(8) & fstat(1) ... df(1)
Nicely encapsulated where-to start to look.

Thanks,
/S
__________________
Never argue with an idiot. They will bring you down to their level and beat you with experience.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HOWTO: Lightest XFCE - Making XFCE lighter and faster vermaden Guides 27 2nd September 2010 12:24 PM


All times are GMT. The time now is 02:28 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick