neizv Posted March 30, 2008 Share Posted March 30, 2008 Hi Guys, I'm running a website where users can customize their homepage. The homepage contains around 100 different pre-cached HTML blocks. The logic behind is pretty simple and originally was based on idea to avoid using MySQL calls there. So, as an alternative solution PHP builds the structure and uses "INCLUDE" functionality to display the blocks. Recently my traffic has grow to 30K hits a day and dedicated server is running a little low (see report below). In additional to other processes I assume that using such big number of INCLUDE functionality also affecting server performance. Any thought or suggestions? p.s. The server is dedicated, Quoter core, 2GB ram, SCSI, RAID..etc 12:00:01 AM runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15 12:10:01 AM 10 248 2.38 2.55 2.75 12:20:01 AM 7 299 3.33 4.04 3.50 12:30:01 AM 1 269 4.15 4.97 4.31 12:40:01 AM 9 226 3.06 4.09 4.31 12:50:01 AM 5 231 3.46 4.00 4.15 01:00:01 AM 8 226 2.17 2.94 3.52 01:10:01 AM 1 321 2.36 2.65 3.10 01:20:01 AM 9 248 3.49 3.69 3.41 01:30:01 AM 8 345 3.83 4.17 3.89 01:40:01 AM 8 332 3.93 4.30 4.11 01:50:01 AM 6 336 1.99 2.76 3.45 02:00:01 AM 5 329 1.82 2.74 3.24 02:10:06 AM 1 359 7.68 5.27 4.24 02:20:01 AM 5 338 3.07 4.25 4.29 02:30:01 AM 8 327 3.78 4.20 4.31 02:40:01 AM 5 341 4.22 4.41 4.41 02:50:01 AM 6 320 2.38 3.33 3.85 03:00:01 AM 7 325 2.06 2.37 3.06 03:10:01 AM 5 391 4.12 3.60 3.35 03:20:01 AM 5 331 3.56 3.34 3.22 03:30:01 AM 5 328 3.88 4.21 3.73 Average: 6 308 3.37 3.71 3.72 Link to comment https://forums.phpfreaks.com/topic/98634-comparing-include-file-file_get_contentsetc-or-an-alternative-to-include/ Share on other sites More sharing options...
trq Posted March 30, 2008 Share Posted March 30, 2008 If the files being included are simply static html then echoing the result of file_get_contents would be the most efficient solution. Include actually runs the file through the php interpretor. Link to comment https://forums.phpfreaks.com/topic/98634-comparing-include-file-file_get_contentsetc-or-an-alternative-to-include/#findComment-504776 Share on other sites More sharing options...
neizv Posted March 30, 2008 Author Share Posted March 30, 2008 Thats exactly what I thought. Thanks a lot! Link to comment https://forums.phpfreaks.com/topic/98634-comparing-include-file-file_get_contentsetc-or-an-alternative-to-include/#findComment-504807 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.