How important is the speed of the OFBiz E-Commerce frontend
Speed of an e-commerce website is pretty important if you look at this article There you will see that a 1 second slower website of Amazon.com, decreased sales by 10%. It is therefore important that pages are loading fast. So when we develop OFBiz e-commerce solutions for our customers we always do a speed test to make sure the website is loaded as quick as possible and that there are no programming errors caused it to slow down unnecessarily.
Test the speed.
How do we test" We normally use at least the "Apache Benchtest” which is part of the Apache Webserver. It is a rather old program but very useful. It is trying to request a certain website page repeatedly and will measure the time in which the requests are returned. Another program is Apache Jmeter. We also use http://www.webpagetest.org.
OFBiz 'visit' function .
OFBiz has the facility to log any action on the system in several different entities. Although this can be useful for a back-end system, it can also slow down the e-commerce front end. See the visits.properties files for a number of settings, including to disable this function.
If you want disable this function, remove also all records from the 'visit' related entities to save database space.
Another point to watch out for is that you have to use the cache for any retrieval function in your customized code. What also can be done is to load all articles in the cache at startup time, see the option on the catalog home page.
Look at the log where from GenericDAO.java is reported where a query takes longer than 150 millisecond. We just extended the message where the entity name is now inserted including the 'where' clause to track the cause of long queries easier.
' Where' fields selection.
if a specific field values are selected make sure the field is indexed. However not too many indexes because then inserts will get slow.
Selection of a list.
If you are selecting a list of records make sure that only the records are retrieved which are shown on the screen, not all records in the list. In that case use an iterator and only get records shown on screen.
If you would like us to improve the speed of your OFBiz website let us know at email@example.com !
For further more general information improving your (e-commerce) website see the article at the 'howto' website.
Posted on: 2010-10-26 11:42:37.175 By hansbak
We recently found out that retrieving database data inside an ftl is not a good idea, not only bad practice but very slow. Retrieving data should be, as much as possible, only be done in the 'action' part of screens.
Commented On: 2011-10-23 18:49:59.375 By hansbak