Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Ian ScottCourses Plus Student 17,145 Points
PHP template engine and site speed
I am a web designer/front-end developer with basic to immediate php knowledge working with a php ex perl programmer. I am now wanting to learn php to a advanced level.
I and the php programmer have been developing a directory website over the last few years. This is my first experience working with a php programmer and somewhat frustrating!
The live site always having functionality issues. The live site had slow site loading speeds until he told our boss to add more servers. The site is not a very large site and receives approx 2000 visitors a day. However needs 4 servers to run it at a acceptable speed. Is this normal or unusual to need so many servers?
The site has a template engine developed by the php programmer using these tags [% %] in the templates.. My question is does a template engine slow down the website? And what is the purpose of using a template engine when I can work with php? I also work within his php scripts and always have to rewrite any layout html he creates, because he uses allot of tables and nested tables for layout.
The site also is duplicated on 2 servers. One server for non-members/logged out members and one server for logged in members.
Thanks in advance..
Kit Pierce2,721 Points
What you're describing is really atypical. For a site that has the traffic you describe, one server can easily handle 2000 visitors a day.
Of course, there are variables that aren't accounted for.
For instance, does the directory site traverse the system disk? There could be a speed issue there. How about database access? Poor DB architecture and slow queries can kill performance. Does your mysql log slow queries? You'd want to check on that.
I've been developing in PHP for more than a decade, and I've not seen a scenario that would need separate servers for logged in members versus others with 2000 visitors a day.
Sounds like you have serious architecture issues on your hands.
Ian ScottCourses Plus Student 17,145 Points
Thank you Kit for your response. I believe the Php programmer duplicated the site on 2 servers, one for logged in users and one for logged out or non members, because of friendly urls.
I used to do the SEO and had great success over the years developing and ranking my own Wordpress based sites. I asked the programmer to create friendly urls and he argued against it. He also said friendly urls will break the site. I found this very unusual??
He has now created kind of friendly urls on the logged out/non member site and when logged in. The user is redirected to another server which has unfriendly urls. The logged in site is run on SSL https.
Before adding more servers. There was allot of problems when updating profiles such as photos. The site was extremely slow updating the photos on the non members/not logged in site. The programmer said it takes time for the databases to sync, sometimes half an hour.
I feel when I ask any questions regarding my concerns with the way the website has been developed. The programmer is not being being 100% honest, because of my lack of knowledge in Php programming and first time working on a Php site from scratch.
I see websites such as Wordpress and Vbulletin forums that run on 1 server and 1 site with friendly urls site wide with allot more traffic. This is why I am concerned and it seemed unusual to me. I feel like I am learning the wrong way to build sites.
As for the other problems you stated, I do not know. And the Php programmer is reluctant to tell me anything. His only answer is the site has allot of queries and that's why we have to keep adding servers as the site grows. So I am thinking, what happens if the site receives 5000 visitors a day. Do we add more servers...
If I raise any concerns with my boss, she tends to brush me off as he is the Php programmer and I am not. Very frustrating! He tends to want to control everything to better his position in the small company.