Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Ian Scott
PLUS
Ian Scott
Courses 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..

2 Answers

Kit Pierce
Kit Pierce
2,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 Scott
PLUS
Ian Scott
Courses 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.

Kit Pierce
Kit Pierce
2,721 Points

Good luck, Ian. Something certainly sounds amiss, and you seem to have a bit of an uphill battle ahead of you.