Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Server-friendly Php Scripts
arp240
post Mar 2 2005, 05:02 PM
Post #1


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 5
Joined: 2-March 05
Member No.: 2,862



Hi

I'm relativly new to php...
I'm interested in writing server-friendly php scripts and i was wandering in what cases php scripts are harmfull to server i runs on...
i was thinking about issues like:

* Which php functions are expensive from the point of view of server's performance and resources?

* What is considered to be a long array in php context if ,say, each record is 100 bytes long? (100+ element ? a few thousands?)

* Are there some assumptions that php programmer should avoid?
(comes to mind this example:http://il.php.net/register_globals )

* I working on my own little and simple database using b+ trees (index data structure). It is being written with php. The thing that warries me is disk access...
Will it be noticable for server or not dry.gif
For example, to serve forum page with 25 posts it will require ~30 disk access(each one preceded by appropriate seek operation) 25 of these are to read all 25 posts and the rest are for internal houskeeping.
I know that real databases will probably do even more work and take a lot more resources but the difference is that real db can handle the request asynchrounelsy(server can do other things in between) and real db executing much faster than parsing and iterpreting php script)

* I will be glad to hear anything else that i didn't think about...

thanks
Go to the top of the page
 
+Quote Post
jipman
post Mar 3 2005, 06:31 PM
Post #2


Pretty please?
Group Icon

Group: Members
Posts: 733
Joined: 28-November 04
From: Holland
Member No.: 1,552



It all depends on the server, if you have a good / fast strong server, it processes much faster. You can't give a hard limit of what is much, because that's different for each server.

I don't think you have to worry much, servers today are quite powerfull
Go to the top of the page
 
+Quote Post
ChronicLoser
post Mar 6 2005, 05:53 PM
Post #3


Premium Member
Group Icon

Group: Members
Posts: 240
Joined: 13-November 04
From: Arizona
Member No.: 1,356



hmm, i guess there are ways that php can be somewhat harmful to the server you run on, but like jipman said, I doubt that a code can mess with the server too much unless it is doing some infinite loop or something. They're pretty high-tech nowadays ^_^
Go to the top of the page
 
+Quote Post
coder2000
post Mar 8 2005, 01:39 AM
Post #4


Member [ Level 2 ]
Group Icon

Group: Members
Posts: 56
Joined: 24-December 04
Member No.: 1,874



The only real damage is from improperly permissioned or owned files. Register globals is only available from a server config so you can't turn it on from a script. Most databases cache the most used sql statements. Now I don't know how much that is done with MySQL but they aren't as taxing on a hdd as you might think.
Go to the top of the page
 
+Quote Post
arp240
post Mar 8 2005, 10:25 AM
Post #5


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 5
Joined: 2-March 05
Member No.: 2,862



Ok, thanks:)
Go to the top of the page
 
+Quote Post
Hercco
post Mar 9 2005, 08:46 PM
Post #6


Super Member
Group Icon

Group: Members
Posts: 595
Joined: 4-September 04
Member No.: 228



Well one thing that people often forgets when dealing with HTML (or whatever) outputting scripts is that which the scripts (program wise) are usually quite simple and with modern machines run very fast, but it's the I/O that is the slow thing.

So instead of doing like a million echo calls, it's faster to group your stuff together and do just few echos.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Mini Apache Server W/ Php(5)
  2. Server Os(13)
  3. How To: Create PDF With Php(18)
  4. Uploading Image File Through JSP Code To Server(9)
  5. Counter-Strike Source Clans - Post Your Server IPs(18)
  6. Restarting Apache Server(14)
  7. How Do I Host My Own America's Army Server?(4)
  8. Server Behind Router(7)
  9. How To Set Up A Dedicated Server(29)
  10. Help: Setting Default Index Page on XAMPP Web-Server(5)
  11. Free Ragnarok Online Server(5)
  12. Counter Strike Server(4)
  13. Most Seo Friendly Forum(7)
  14. Common Ftp Server Error Codes(0)
  15. Create An Ftp Server On Your Pc With Serv-u(1)
  1. Bulletproof Ftp Server Tutorial(0)
  2. Free Remote Wireless Server?(1)
  3. New Ro Server(2)
  4. Wamp Server Problems(5)
  5. Is It Possible To Make Php Scripts Executed Without A Cron?(2)
  6. Server With Quest?(6)
  7. Gmail For Mail Server.(7)
  8. How To Validate The Login Form Using Php Pcre(0)
  9. How To Make Sure Your Server Can Generate Images(0)
  10. Google App Engine(1)
  11. Email Server / Cpanel Problems(1)
  12. In Php- How To Send Mail From Localhost To Web Mail Server(0)
  13. View Php In Another Server(4)


 



- Lo-Fi Version Time is now: 23rd November 2008 - 12:51 AM