Is there performance hit running templates as text files?
Posted: 25 April 2008 12:46 PM   [ Ignore ]  
Grad Student
Rank
Total Posts:  31
Joined  04-02-2008

For development purpose, I run all templates as text files.  Now I have migrated the site to a live server.  Is there a performance hit or should I turn it off?

If I should turn it off on the live site, what’s are the recommended steps?  Do I go to every single template to reload the content, un-click the “Save Template as File” checkbox and save it into database.

Profile
 
 
Posted: 25 April 2008 01:27 PM   [ Ignore ]   [ # 1 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6243
Joined  08-04-2002

Don’t have any thread pointers but from everything I’ve read, there is no performance hit of any consequence, if at all.

Profile
 
 
Posted: 25 April 2008 09:07 PM   [ Ignore ]   [ # 2 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  19293
Joined  06-03-2002

There is additional disk i/o for the file, of course, but it’s just read access, so unless you have an unusually high traffic site, I don’t think even anyone monitoring the server closely would notice a blip.  And if you _do_ have an unusually high traffic site, it’s likely that you already have a server environment with a disk array that can handle it.

That said, there is convenience to keeping it all in the database on a production site.  If your host (or you) make regularly scheduled database backups, then the templates are included with such a backup.  Perhaps not a big deal if you also make regular file backups, but I prefer to keep everything in one place when I can.

 Signature 
Profile
MSG
 
 
Posted: 28 April 2008 12:08 PM   [ Ignore ]   [ # 3 ]  
Grad Student
Rank
Total Posts:  31
Joined  04-02-2008

Thanks to all.  I will leave the templates as text files then as it makes porting the template changes over much easier via FTP.

Profile
 
 
Posted: 28 April 2008 12:43 PM   [ Ignore ]   [ # 4 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6243
Joined  08-04-2002

Once a site is live and stable, I usually take it into the database as I’m rarely accessing with anything major. It is kind of a pain as you need to visit every template, switch the file save off and refresh. Wished there was a master switch :-)

Profile
 
 
Posted: 28 April 2008 02:29 PM   [ Ignore ]   [ # 5 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  29227
Joined  05-15-2004

A master query, perhaps?

UPDATE exp_templates SET save_template_file = "n" WHERE save_template_file = "y"

Untested, so use at your own risk smile

 Signature 

ExpressionEngine 2.0 Downloads | Docs | Bugtracker

“If the English language made any sense, lackadaisical would have something to do with a shortage of flowers.” (Doug Larson)

Profile
MSG
 
 
Posted: 28 April 2008 03:19 PM   [ Ignore ]   [ # 6 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6243
Joined  08-04-2002

Thanks Ingmar, don’t have anything to test on at the moment but have the code so will try when possible.

Profile
 
 
Posted: 28 April 2008 03:21 PM   [ Ignore ]   [ # 7 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  19293
Joined  06-03-2002

Well, you still need to save via the form, or EE will serve the potentially-stale database version of the template.

 Signature 
Profile
MSG
 
 
Posted: 28 April 2008 03:25 PM   [ Ignore ]   [ # 8 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  29227
Joined  05-15-2004

Ouch, good catch there. So, there’s no way to fully automate that, Derek?

 Signature 

ExpressionEngine 2.0 Downloads | Docs | Bugtracker

“If the English language made any sense, lackadaisical would have something to do with a shortage of flowers.” (Doug Larson)

Profile
MSG
 
 
Posted: 28 April 2008 03:32 PM   [ Ignore ]   [ # 9 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  19293
Joined  06-03-2002

Well, no one-line way.  A quick PHP script in a template could handle it, grabbing content from files of all saved templates, and updating the database.

 Signature 
Profile
MSG
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120595 Total Logged-in Users: 76
Total Topics: 126636 Total Anonymous Users: 34
Total Replies: 665686 Total Guests: 388
Total Posts: 792322    
Members ( View Memberlist )