Episerver CMS performance optimization – part 1

Update: In Episerver CMS 11, released today (November 21st 2017), the simpleaddress router has been moved to the last of the route table.

Original post:

This is an unusual post – it is not about Commerce – my area of expertise, but about CMS. Recently I’ve been working on some support cases where SQL Server instance is on high utilization, and in some scenarios it eventually slows down the site. After investigation, it’s likely to come from a small, simple and helpful feature: Simple address.

CMS content can have a property named “Simple address”, which allows you to create a “shortcut” url for that content. So if you have one page with “name in url” as “contact-us” under a page name “about-us” under Home page, you can access it via https://mysupercoolsite.com/en/about-us/contact-us. Or you can set the Simple address for that page as “contact-us”, and then you can access it directly via https://mysupercoolsite.com/contact-us.

Continue reading “Episerver CMS performance optimization – part 1”

Merging carts when a customer logs in

It’s quite common when a customer browses your site without logging in – either she/he intentionally does that, or just forget about logging in. The customer might add some items to carts and even checks out, but then is asked to log in or remember to log in. What would happen?

By default, Episerver Commerce will do as following:

  • Attach all orders made by that section to logged in customer. (I once placed an order in a famous retailer in Sweden without logging in, and then I asked their customer service to link that order to my account so I can track it easier. To my surprise, it cannot be done! That’s why I personally appreciate this feature.)
  • Merge all carts to existing carts, by name and market. So if I’m currently in US market and I added a item to that cart, and the US-cart linked to my account already have 2 other items, then when I log in, my US-cart will contain 3 items.
  • Merge all wishlist to existing wishlists, also per market. (The name for wishlist, by default, is fixed to “Wishlist”)

Continue reading “Merging carts when a customer logs in”

Multisite in Episerver Commerce

It seems that we currently have an increasing number of questions regarding multisite feature in Episerver Commerce. It’s fully supported in CMS. You can have only one site, one database to serve multiple domains – which of course reduces the cost. But can it be done in Commerce as well?

The answer is (as almost always): it depends on your definition of “multisite”: multisite can be that customers see multiple domains, which probably different styles, but in the backend everything is the same – you share the same collection of orders and customers. Or multisite can be that there is a separation in backend: each site has its own collection of orders and customers.
Continue reading “Multisite in Episerver Commerce”

Can Episerver Commerce support our catalog size?

One of the questions customers usually raise during evaluation of Episerver Commerce is : “Can it support our catalog size? We have (a very big number of ) SKUs. Will it work?”

Definitely, maybe.

I’ve seen “big” catalogs. Some very big. Million and more products.

The correct term would be “Entries”, as in a standard implementation your catalog can contain products, variants (of those products, or standalone ones), bundle and package. However for the sake of simplicity, we will refer to them as “products”. So when we talk about 2 million products, it is the 2 million entries. (you can have 100k products, 1.800k variants and 100k packages)

Theoretically, Episerver Commerce can support up to 512 millions 1 billion of entries (!), so you can have pretty much anything in your catalog until you reach a hard technical limit. Just for comparison, Amazon.com, which is arguably the biggest eCommerce site on the world, has about 500 millions SKU(s) in 2015. But the number of entries is not everything. There are several factors which determine your catalog “size”. the number of entries is an important factor, but there are several other factors as well.

Continue reading “Can Episerver Commerce support our catalog size?”

Watch your indexes closely

Recently we were tasked to help a customer having a problem with a query. This specific query ate a lot of CPU resources (30-40%) and causing performance problem for other queries – as it slows the entire SQL Server instance down.

Upon investigation, we discovered that the query was accessing a table with an outdated index. The index was supposedly updated in Episerver Commerce 7.10.3, which was released almost 3 years ago.

For some reasons, the index was not updated in customer’s table. Instead of just having to do a index seek, SQL Server was forced to do a full table scan, which is much slower, causing the problem.

If you want to go into details, it’s mdpsp_getchildrenbysegment stored procedure, which looks into UriSegment column of CatalogItemSeo table, previously, the index was like this:

CREATE NONCLUSTERED INDEX [IX_CatalogItemSeo_UniqueSegment_CatalogEntry] ON [dbo].[CatalogItemSeo]
(
    [ApplicationId] ASC
    [UriSegment] ASC,
    [CatalogEntryId] ASC
)

You can see the problem: The order of the index was bad – because ApplicationId was not distinctive (in fact, in most of the cases it’s the same for every row), and because UriSegment was not the first column in the index, this index will not be used if a query uses UriSegment only. Continue reading “Watch your indexes closely”

Quicksilver + ServiceAPI: the authentication issues

It’s possible to run Quicksilver and ServiceAPI on a same site, with some modifications, as I blogged here. However, if you go down that path, there is something you must keep in mind: They are not using the same authentication mechanism.

I’ve seen issues where Quicksilver implementations have some WebAPI controllers, which were working fine until ServiceAPI is installed. The controllers started returning null for CustomerContext.Current.CustomerContact, and so on, breaking some functionalities. It’s bad, yes, but it happens because of reasons.

Continue reading “Quicksilver + ServiceAPI: the authentication issues”

How can Horizon: Zero Dawn be (even) better?

If you own a PS4, you might want to try out Horizon: Zero Dawn, and if don’t have a PS4, you might want to buy a PS4 Pro + a HDR TV to try it out. Yes, the game is a blast to play: vast, beautiful world – which will drop your jaw frequently, and fun, exciting combat with the dino-robots. The game is selling very well and an expansion is under the work already – and I’d not be surprised if a sequel Horizon: Zero Dawn is announced in the future. But, can it be better? Yes! How?

Continue reading “How can Horizon: Zero Dawn be (even) better?”

The super short review of Horizon: Zero Dawn

Plus:

  • The game is very well polished. Everything seems smooth, and I’m yet to see any game breaking bugs (I’m looking at you, Witcher 3, and XCOM 2)
  • A vast, beautiful open world. Probably the most beautiful ever in a game. Even on the original PS4, it looks spectacular. PS4 Pro + HDR will blow your mind away – well, Sony made sure the game is a showcase for PS4 Pro, so that’s expectedIf you think Rise of Tomb Raider was visually stunning, think again. HZD easily blows it out of water. In short, it will drop your jaw!
  • The combats versus machines are engaging and rewarding. The bigger, badder the robot, the more satisfying you’ll be after a battle. You will have to be both smart, and fast to win. The variety and diverAlso, the Critical Hit move feels both powerful and satisfying.

Neutral:

  • The story is fine, but not really ground breaking. Passable but don’t expect anything like The Witcher 3.
  • The open world settings get bored after a while. Still many things to do, but you’ll probably want more.

Minus:

  • The combats versus humans are … meh. It’s not that bad, but compared to the machines, humans are just boring enemies which bring very little enjoyment to the table.
  • The voice acting is underwhelming. In many cases, voice actors do not sound convincing as they should. The NPC faces are also quite generic and you’ll have hard time remember who is who.
  • Stealth action is a joke – you caused an explosion and your enemies are still acting like nothing happen. If you expect the level of Metal Gear Solid V depth – I have bad news for you.

Verdict:

9/10. Buy it! If you have PS4 Pro + HDR TV and it’s easily a must have. If you don’t, then this is a very valid reason to buy those!

Tale from inside TransactionScope

One of the last things you want to get from your Commerce site is that the order data is gone. What can be more confused than if your log shows that the cart has been converted into a purchase order, you even got the PO number, but after that, the order disappears? It’s nowhere to be found, even if you look into database. It’s kind of magic, but not the kind of magic you would want to have.

But everything happens for a reason. And actually it’s with a good reason: data consistency.

Episerver Commerce has the concept of TransactionScope. Simply put, it allows two or more database operations to be done as atomic: Either all of them succeed, or all of them will revert back. If a TransactionScope contains 3 operations A, B, C, then even if A, B succeeded, but C is yet to commit, and something goes wrong, then A and B would be reverted.

Continue reading “Tale from inside TransactionScope”

PS4 firmware 4.5 wifi problem fixed

And finally the much anticipated 4.5 firmware of PlayStation 4/4 Pro has arrived, with some very neat features: extended storage, custom themes. It’s a big improvement for PS4 users, well, almost: the firmware comes with a big problem for ones who are using wifi: the download speed is now terrible, and even worse, the lag in game is making the games unplayable. Before 4.5, I had no problem joining matches on Uncharted 4, and playing Titanfall was very smooth – ping is never more than 100ms. After 4.5, I can’t hardly join a match on Uncharted 4 (errors in connections), and the lag in Titanfall spikes to more than 2000ms, making the game totally unplayable. Test Internet Connection shows that I have a a few hundred Kbps upload and download, when the wifi connection is supposed to be 130Mbps (PS4 ony has 2.4Ghz wifi 802.11 b/g/n, only PS4 Pro has 5Ghz wifi), and my internet connection is 250/100Mbps, so that must be a big problem somewhere.

Continue reading “PS4 firmware 4.5 wifi problem fixed”