<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>CppCMS Blog</title>
	<link>http://art-blog.no-ip.info/cppcms/blog</link>
	<description>A blog on CppCMS - C++ Web Development Framework</description>
	<atom:link 
		href="http://art-blog.no-ip.info/cppcms/blog/rss" 
		rel="self" type="application/rss+xml" />
	
		
		<item>
			<title>Asp.Mono in Linux? Not Yet...</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/27</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/27</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;During development of CppCMS I have always wanted to do some benchmarks against one of the most popular web development technologies: Asp.Net. I had found a blogging system: &lt;a href=&quot;http://www.dotnetblogengine.net/post/BlogEngineNET-145-released-today.aspx&quot;&gt;BlogEngine.Net&lt;/a&gt; that in its latest version had full support of mono under Linux, support of MySQL &amp;mdash; all I need to run benchmarks against CppCMS.&lt;/p&gt;

&lt;p&gt;The beginning was promising. The instructions were simple, there was an actual blog running BE.Net under Apache mod_mono on Ubuntu. There were &lt;a href=&quot;http://blog.ruski.co.za/page/Install-BlogEngineNET-on-Ubuntu.aspx&quot;&gt;Linux specific&lt;/a&gt; instructions as well. &lt;/p&gt;

&lt;p&gt;So, first of all I had installed mono 1.9.1 from Etch backports. The first problem I had to deal with was an installation problem &amp;mdash; the version of C# compiler and mono environment were different. This was solved quite simply. So, I could finally see BE.Net running under Mono using XML as data storage backend.&lt;/p&gt;

&lt;p&gt;Then, I wanted to add MySQL storage backend. The problems had come very soon. The MySQL database script was written under assumption that table names are case insensitive. That was not true for MySQL under &lt;em&gt;Linux&lt;/em&gt;. This problem was fixed.&lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/27"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>Thoughts about template system</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/26</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/26</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;After looking how ASP.Net and J2EE work I thought a lot about current template
system.&lt;/p&gt;

&lt;p&gt;Today, CppCMS template system is dynamic typed. For example in order to render
template:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;% template mycontent %&amp;gt;
&amp;lt;p&amp;gt;You have &amp;lt;% number %&amp;gt; of &amp;lt;% something %&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;% end %&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I write something like that (not correct code but idea):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;map&amp;lt;boost::any&amp;gt; content;

content[&quot;something&quot;]=string(&quot;orange&quot;);‎
content[&quot;number&quot;]=10;

template.render(content,output); 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The template is compiled to bytecode and than interpreted in rendering engine.
If variable &lt;code&gt;title&lt;/code&gt; required it checks its type and renders its content.&lt;/p&gt;

&lt;p&gt;Another possible approach it to make is statically typed :&lt;/p&gt;

&lt;p&gt;So, I create a view interface for template:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;struct mycontent: public content {
  string something;
  int number;
};
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And then the above template is compiled to following C++ code:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;void mycontent::render()
{
  cout&amp;lt;&amp;lt;&quot;&amp;lt;p&amp;gt;You have &quot;&amp;lt;&amp;lt;number&amp;lt;&amp;lt;&quot; of &quot;&amp;lt;&amp;lt;escape(something)&amp;lt;&amp;lt;&quot;&amp;lt;/p&amp;gt;\n&quot;;
} 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That is compiled to shared object that I can load dynamically. And render
template as following:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;auto_ptr&amp;lt;my_content&amp;gt; content(template.get(&quot;my_content&quot;));
content-&amp;gt;number=10;
content-&amp;gt;something=&quot;orange&quot;;

content-&amp;gt;render(output); 
&lt;/code&gt;&lt;/pre&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/26"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>Caching System: Internals</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/21</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/21</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;One of the latest implemented features of CppCMS is a caching system.&lt;/p&gt;

&lt;p&gt;Each cached entry is stored using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unique key that defines the entry&lt;/li&gt;
&lt;li&gt;An actual data&lt;/li&gt;
&lt;li&gt;Entry lifetime period.&lt;/li&gt;
&lt;li&gt;The set of triggers &amp;mdash; this is a feature that is not available in many cache system like &lt;a href=&quot;http://www.danga.com/memcached/&quot;&gt;memcached&lt;/a&gt;.&lt;br/&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;For example: main page that displays 5 recent posts may have a key &lt;code&gt;main_page&lt;/code&gt; and triggers: &lt;code&gt;post_123&lt;/code&gt;, &lt;code&gt;post_124&lt;/code&gt;, &amp;hellip; , &lt;code&gt;post_128&lt;/code&gt;. More then that, each time, during page build, when you fetch some cached data, like a sidebar or set of options, their sets of triggers are automatically added to the set of triggers of the page you build.&lt;/p&gt;

&lt;p&gt;For example, when the page is created and sidebar block is fetched from cache all its triggers are automatically added: if &lt;code&gt;sidebar&lt;/code&gt; depends of &lt;code&gt;options&lt;/code&gt;, then trigger &lt;code&gt;sidebar&lt;/code&gt; and &lt;code&gt;options&lt;/code&gt; will be automatically added to triggers of &lt;code&gt;main_page&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Thus, when certain trigger is risen, all pages that depends on it are automatically trashed. This makes a cache system quite powerful and easy to control correct data representation. &lt;/p&gt;

&lt;p&gt;The developer is expected to create a rational model of data/triggers that
represent the relations between parts of internal data and rise these triggers
when committing changes to database.&lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/21"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>First Beta Version of CppCMS is Out!</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/25</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/25</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;First beta version is avalibile under LGPL 2.1 from &lt;a href=&quot;https://sourceforge.net/project/showfiles.php?group_id=209965&quot;&gt;SourceForge&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CppCMS Framework&lt;/li&gt;
&lt;li&gt;Templates System&lt;/li&gt;
&lt;li&gt;DbiXX SQL Layer&lt;/li&gt;
&lt;li&gt;Examples of usage&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Good Luck!&lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/25"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>API Changes and mod-prefork</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/24</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/24</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;There have been lot of work in recent weeks in order to make deep internal changes in the framework. Now they include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Transparent support of 3 web server APIs: fastcgi, cgi and scgi.&lt;/li&gt;
&lt;li&gt;Support of new mod prefork that allows safer management of worker processes.&lt;/li&gt;
&lt;li&gt;Implementation of a cache that is shared between forked processes.&lt;/li&gt;
&lt;/ol&gt;


			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/24"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>A  new name for CppCMS Project?</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/23</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/23</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;Now it is clear for me that CppCMS is not quite successful name for this project. Manys think that it is rather Content Management System like Drupal written in C++, then A C++ Web Development like Django that allows you to write CMS.&lt;/p&gt;

&lt;p&gt;So think is it worth to change the name of the project to something other? If so what name to choose?&lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/23"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>CppCMS vs WordPress</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/22</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/22</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;h3&gt; Setup&lt;/h3&gt;

&lt;p&gt;I had compared two blog systems: this one and WordPress 2.5 with a patched WP-Cache-2 addon. I used following configuration:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Web Server lighttpd 1.4.13&lt;/li&gt;
&lt;li&gt;Interface FastCGI&lt;/li&gt;
&lt;li&gt;PHP 5.2&lt;/li&gt;
&lt;li&gt;Bytecode cacher: XCache 1.2.1&lt;/li&gt;
&lt;li&gt;Database MySQL 5.0&lt;/li&gt;
&lt;li&gt;Caching for WP: WP-Cache-2 with an additional &lt;a href=&quot;http://art-blog.no-ip.info/cppcms/blog/post/20&quot;&gt;performance patch&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Hardware: AMD Athlon XP 64bit, 1G RAM&lt;/li&gt;
&lt;li&gt;OS: Linux, Debian Etch 64bit.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;I prepared two blogs that  were filled up with 1000 articles each. Each article had 10 comments, all the articles were organized in 10 categories in each blog.&lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/22"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>Patch For WP-Cache-2 plugin</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/20</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/20</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;I'm going to run a heavy benchmarks comparing WordPress &amp;ndash; the blog system I know very well, with CppCMS based blog &amp;ndash; the system I had written.&lt;/p&gt;

&lt;p&gt;The new caching system that was developed for CppCMS is quite smart, it stores
the entry pages twice: original and gzip compressed. On heavy loads, this allows
serving pages significantly faster because only thing that should be done is
to push html or compressed html page directly from the cache. Otherwise, gzip 
compression (even fastest) would take lots of resources and reduces a preformace of the system.&lt;/p&gt;

&lt;p&gt;When it comes to benchmarks, I had discovered that WP-Cache-2 plugin does the
job well, but it caches only html version of the file, thus, even if the 
page is cached it still must pass a compression by Apache&amp;rsquo;s mod_deflate or by PHP engine itself. &lt;/p&gt;

&lt;p&gt;I had patched this plugin and now it stores two versions of same page: an original and compressed. and was able to get 60% performace improvement.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;WordPress native plugin: 450 requests per second&lt;/li&gt;
&lt;li&gt;WordPress patched  plugin: 720 requests per second&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So after this patch I can feel that the benchmarks would be proper, because without it this would be incorrect to compare time required for fetching a cache 
with the time required for compressing entry page.&lt;/p&gt;

&lt;p&gt;Links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://mnm.uib.es/gallir/wp-cache-2/&quot;&gt;WP Cache 2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://art-blog.no-ip.info/files/wp-cache.patch&quot;&gt;Patch&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;strong&gt;N.B.:&lt;/strong&gt; The full benchmarks coming soon&lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/20"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>Building CppCMS</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/6</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/6</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;I had not published any official alpha or beta release yet, however, anyone who wants to use it can install the framework quite easily (I think).&lt;/p&gt;

&lt;p&gt;There are three major parts of the framework:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Templates support module &amp;ndash; &lt;em&gt;libtmpl&lt;/em&gt; or templates subproject.&lt;/li&gt;
&lt;li&gt;C++ Wrapper for dbi DB access library &amp;ndash; &lt;em&gt;libdbixx&lt;/em&gt; or dbixx subproject&lt;/li&gt;
&lt;li&gt;Base framework &amp;ndash; &lt;em&gt;libcppcms&lt;/em&gt; or framework subproject.&lt;/li&gt;
&lt;li&gt;This blog &amp;ndash; an example how to use CppCMS or cms subproject&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Thus in order to install the system we need to do following:&lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/6"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>Blog Upgrade</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/19</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/19</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;I've been working for quite a long time on a new version of this blog. I had two primary reasons to put 100% of development effort to this quite simple CMS:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I wanted to understand the real needs for different parts of this framework: templates, dbixx and others.&lt;/li&gt;
&lt;li&gt;I felt that an old version has too few features that do not allow me to write posts I really need.&lt;/li&gt;
&lt;li&gt;I want to replace my &lt;a href=&quot;http://art-blog.no-ip.info/wp&quot;&gt;Hebrew Blog&lt;/a&gt; that is based on &lt;a href=&quot;http://wph.co.il/&quot;&gt;WordPress&lt;/a&gt; with something mature enough to be able to migrate to new CMS.&lt;br/&gt;
This is mostly &quot;political&quot; reason &amp;ndash; I should use CMS I write with this framework.&lt;/li&gt;
&lt;/ol&gt;


			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/19"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
	
</channel>
</rss>
