The Catalog UI trade-off: performance or better UI

I supposed this is a well known feature, but I was asked more than once about it, so it’s better to write something here to clarify the confusions.

If you have some very, very big catalogs, you probably have seen this “notification” in Catalog UI

By default, the Catalog UI groups a product and its variations in a parent-children view (they are not exactly parent-children, by the way). However, to do that, it needs to know about all the entries in that specific category. If it’s a small category, it should be no problem, but if it’s big one, then it’s inevitable slow. The lazy loading which the catalog content list only loads the contents when you scroll to them is not helping in this matter. Moreover, the grouping introduces an overhead for the UI, and having too many groups can severely affect the performance. Trust me, you won’t like a sluggish UI.

This improvement was introduced way back – 7.11 if I remember correctly – thanks to my colleague Magnus Rahl. To this day it’s still valuable – the performance was improved – but not that much to remove the threshold completely (And the improvement to the catalog versioning in Commerce 9 should have nothing to do with this).

When you see this notification, and if you’re unhappy with it, you have two (primary) options: Either to sub-categorize your category – i.e. introduce sub categories so each will have a smaller number of entries. Or increase the value of threshold.

Each approach has its own disadvantages. Sub-categorizing might break your SEO, while the second approach will undoubtedly effect the UI performance. Your call!

Now – the tricky part – which number to configure in SimplifiedCatalogListingThreshold setting. Obviously, it must be greater than the biggest number of entries in a category. But how to obtain that number? I’ve seen the confusion to raise that value to 3000, 5000, or even 10000 and it’s still not working. No, you can’t guess, you have to know for sure.

One simple option is to look at Commerce Manager Catalog Management. There is a small text in right corner of the list which shows the number of entries in that category (No, it’s not available in the Catalog UI, but I assume it would be helpful?)

 

The nuke option is to look at the database. Usually we recommend to avoid manipulate the database directly, as it can be dangerous – but here is a little code which only queries data (so practical harmless)

SELECT CatalogNodeId, Count(CatalogEntryId) 

FROM dbo.NodeEntryRelation

GROUP BY CatalogNodeId

ORDER BY Count(CatalogEntryId) DESC

Now you know the biggest number of the entries in a category – just change the threshold in setting. Try it and see if the UI Performance is acceptable to you.

Find.Commerce is not for Commerce Manager

I’ve seen this more than once, and this can be quite tiresome to fix the problem(s) after that. So here the TL;DR: If you are installing Find.Commerce to Commerce Manager, you are doing it wrong.

You’ll probably end up in the error like this

While loading .NET types from "EPiServer.Find.UI" the following error(s) was reported:

     - System.IO.FileNotFoundException: Could not load file or assembly 'EPiServer.Cms.Shell.UI, Version=9.3.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7' or one of its dependencies. The system cannot find the file specified.
File name: 'EPiServer.Cms.Shell.UI, Version=9.3.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'

=== Pre-bind state information ===
LOG: DisplayName = EPiServer.Cms.Shell.UI, Version=9.3.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7
 (Fully-specified)
LOG: Appbase = file:///C:/EPiServer/FindSearchProvider/backend/
LOG: Initial PrivatePath = C:\EPiServer\FindSearchProvider\backend\bin
Calling assembly : EPiServer.Find.UI, Version=12.0.0.4448, Culture=neutral, PublicKeyToken=8fe83dea738b45b7.

Continue reading “Find.Commerce is not for Commerce Manager”

Episerver Commerce performance optimization – part 2

Or lock or no lock – that’s the question.

This is the second part of the series on how can you improve the performance of Episerver Commerce site – or more precisely, to avoid the deadlocks and 100% CPU usage. This is not Commerce specific actually, and you can apply the knowledge and techniques here for a normal CMS site as well.

It’s a common and well-known best practice to store the slow-to-retrieve data in cache. These days memory is cheap – not free – but cheap. Yet it is still much faster than the fastest PCIe SSD in the market (if your site is running on traditional HDD, it’s not even close). And having objects in cache means you won’t have to open the connection to SQL Server, wait for it to read the data and send back to you – which all cost time. And if the object you need is a complex one, for example a Catalog content, you will also save the time needed to construct the object. Even if it’s fast, it is still not instantaneous, and it will cost you both memory and CPU cycles. All in all – caching is the right way to go. But how to get it right?

One common mistake for to have no lock when you load the data for the first time and insert it into cache.

Continue reading “Episerver Commerce performance optimization – part 2”

The hidden danger of dot (Or why should your metafield not contain . in the name)

A dot (.) – it is harmless. What harm can it do, it looks pretty innocent.

And yet it can break your Catalog UI.

Psyduck, from Pokemon Go
A dot can look pretty harmless and innocent, just like a Psyduck. Frankly, its eyes are also two dots.

Catalog UI relies on the Shell UI from CMS to render properties and such. Shell UI, in its hands, needs to know about the metadata of the properties. When you have dot in the metafield names, the MetaDataPropertyMapper will create an Property with that name on site start up. And then when you open All properties mode, Shell UI will request your content type models, and CMS Core will happily return those properties.

Continue reading “The hidden danger of dot (Or why should your metafield not contain . in the name)”

Fixing Visual Studio 2015 after update 3

In case you did not notice, Microsoft released Visual Studio 2015 Update 3 a couple of days ago. I immediately jumped in because I have high hope for better stability – VS2015 update 2 has been crashing more open than I would like.

When I updated my VS on my work computer, all went well and it worked right after that without any problem. However when I finally updated my VS on my home computer, problem appears. Everytime I try to open a solution, it crashes! Rendering my VS2015 totally useless. It’s not a problem I can ignore, and I would avoid reinstall it, unless it’s the last resort.

Digging in the event viewers shed a light on what is wrong:

Application: devenv.exe
Framework Version: v4.0.30319
Description: The application requested process termination through System.Environment.FailFast(string message).
Message: Microsoft.VisualStudio.Composition.CompositionFailedException: An exception was thrown while initializing part "Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzerService". ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Reflection.Metadata, Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
   at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.InitializeDisplayAndId()
   at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.get_Id()
   at Microsoft.CodeAnalysis.Diagnostics.HostAnalyzerManager.CreateAnalyzerReferencesMap(IEnumerable`1 analyzerReferences)
   at Microsoft.CodeAnalysis.Diagnostics.HostAnalyzerManager..ctor(ImmutableArray`1 hostAnalyzerReferences, ImmutableArray`1 hostAnalyzerPackages, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
   at Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzerService..ctor(IDiagnosticUpdateSourceRegistrationService registrationService, IEnumerable`1 asyncListeners, IWorkspaceDiagnosticAnalyzerProviderService diagnosticAnalyzerProviderService, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
   --- End of inner exception stack trace ---
   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()
   at Microsoft.VisualStudio.Composition.DelegateServices.<>c__DisplayClass2_0`1.<As>b__0()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Lazy`1.get_Value()
   at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService.WorkCoordinator.IncrementalAnalyzerProcessor.<>c__DisplayClass15_0.<GetOrderedAnalyzers>b__0(Lazy`2 p)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__1.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items)
   at System.Collections.Immutable.ImmutableArray.ToImmutableArray[TSource](IEnumerable`1 items)
   at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService.WorkCoordinator.IncrementalAnalyzerProcessor.GetOrderedAnalyzers(Registration registration, IEnumerable`1 providers)
   at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService.WorkCoordinator.IncrementalAnalyzerProcessor.GetActiveFileIncrementalAnalyzers(Registration registration, IEnumerable`1 providers)
   at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService.WorkCoordinator.IncrementalAnalyzerProcessor..ctor(IAsynchronousOperationListener listener, IEnumerable`1 analyzerProviders, Registration registration, Int32 highBackOffTimeSpanInMs, Int32 normalBackOffTimeSpanInMs, Int32 lowBackOffTimeSpanInMs, CancellationToken shutdownToken)
   at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService.WorkCoordinator..ctor(IAsynchronousOperationListener listener, IEnumerable`1 analyzerProviders, Registration registration)
   at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService.Register(Workspace workspace)
   at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl.StartSolutionCrawler()
   at Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService.AbstractPackage`2.Initialize()
   at Microsoft.VisualStudio.LanguageServices.CSharp.LanguageService.CSharpPackage.Initialize()
Stack:
   at System.Environment.FailFast(System.String, System.Exception)
   at Microsoft.CodeAnalysis.FailFast.OnFatalException(System.Exception)
   at Microsoft.CodeAnalysis.ErrorReporting.FatalError.Report(System.Exception, System.Action`1<System.Exception>)
   at Microsoft.VisualStudio.LanguageServices.CSharp.LanguageService.CSharpPackage.Initialize()
   at System.Lazy`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].CreateValue()
   at System.Lazy`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].LazyInitValue()
   at System.Lazy`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].get_Value()
   at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService+WorkCoordinator+IncrementalAnalyzerProcessor+<>c__DisplayClass15_0.<GetOrderedAnalyzers>b__0(System.Lazy`2<Microsoft.CodeAnalysis.SolutionCrawler.IIncrementalAnalyzerProvider,Microsoft.CodeAnalysis.SolutionCrawler.IncrementalAnalyzerProviderMetadata>)
   at System.Linq.Enumerable+WhereSelectEnumerableIterator`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
   at System.Linq.Buffer`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]..ctor(System.Collections.Generic.IEnumerable`1<System.__Canon>)
   at System.Linq.OrderedEnumerable`1+<GetEnumerator>d__1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
   at System.Linq.Buffer`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]..ctor(System.Collections.Generic.IEnumerable`1<System.__Canon>)
   at System.Linq.Enumerable.ToArray[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
   at System.Collections.Immutable.ImmutableArray.CreateRange[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
   at System.Collections.Immutable.ImmutableArray.ToImmutableArray[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
   at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService+WorkCoordinator+IncrementalAnalyzerProcessor.GetOrderedAnalyzers(Registration, System.Collections.Generic.IEnumerable`1<System.Lazy`2<Microsoft.CodeAnalysis.SolutionCrawler.IIncrementalAnalyzerProvider,Microsoft.CodeAnalysis.SolutionCrawler.IncrementalAnalyzerProviderMetadata>>)
   at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService+WorkCoordinator+IncrementalAnalyzerProcessor.GetActiveFileIncrementalAnalyzers(Registration, System.Collections.Generic.IEnumerable`1<System.Lazy`2<Microsoft.CodeAnalysis.SolutionCrawler.IIncrementalAnalyzerProvider,Microsoft.CodeAnalysis.SolutionCrawler.IncrementalAnalyzerProviderMetadata>>)
   at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService+WorkCoordinator+IncrementalAnalyzerProcessor..ctor(Microsoft.CodeAnalysis.Shared.TestHooks.IAsynchronousOperationListener, System.Collections.Generic.IEnumerable`1<System.Lazy`2<Microsoft.CodeAnalysis.SolutionCrawler.IIncrementalAnalyzerProvider,Microsoft.CodeAnalysis.SolutionCrawler.IncrementalAnalyzerProviderMetadata>>, Registration, Int32, Int32, Int32, System.Threading.CancellationToken)
   at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService+WorkCoordinator..ctor(Microsoft.CodeAnalysis.Shared.TestHooks.IAsynchronousOperationListener, System.Collections.Generic.IEnumerable`1<System.Lazy`2<Microsoft.CodeAnalysis.SolutionCrawler.IIncrementalAnalyzerProvider,Microsoft.CodeAnalysis.SolutionCrawler.IncrementalAnalyzerProviderMetadata>>, Registration)
   at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService.Register(Microsoft.CodeAnalysis.Workspace)
   at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl.StartSolutionCrawler()
   at Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService.AbstractPackage`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Initialize()
   at Microsoft.VisualStudio.LanguageServices.CSharp.LanguageService.CSharpPackage.Initialize()
   at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(Microsoft.VisualStudio.OLE.Interop.IServiceProvider)
   at Microsoft.VisualStudio.Shell.Interop.IVsUIDataSource.Invoke(System.String, System.Object, System.Object ByRef)
   at Microsoft.Internal.VisualStudio.PlatformUI.DataSource.Invoke(System.String, System.Object, System.Object ByRef)
   at Microsoft.VisualStudio.PlatformUI.VsCommand.Execute(System.Object)
   at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(System.Windows.Input.ICommandSource, Boolean)
   at System.Windows.Controls.MenuItem.InvokeClickAfterRender(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)

So System.Reflection.Metadata, Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ was missing.

But why? and missing from where? A quick search shows that it was used for Roslyn, and dnx uses version 1.1. Visual Studio 2015 also crashes if I try to open Tools => Text Editor => C# => Advanced, where the Roslyn options are. So the problem was Roslyn unable to load an assembly it needs, then the entire VS crashes. Lame!

It seems unable to just reinstall Roslyn alone, so my best bet is to put the correct System.Reflection.Metadata version … somewhere. It’s not clear that where should it be – so I should put it in the most common place – the GAC – Global Assemblies Cache.

This is an attempt to fix:

First, I need to have the assembly. This will require nuget 3.x to run, so you can download the latest version (3.4.4 at this time of writing) from here.

nuget install system.reflection.metadata -version 1.2.0

And then open your Developer command prompt for VS2015, and cd to the lib folder of downloaded package, for me it’s D:\Downloads\System.Reflection.Metadata.1.2.0\lib\netstandard1.1, and run the famous gacutil to install the assembly to GAC:

D:\Downloads\System.Reflection.Metadata.1.2.0\lib\netstandard1.1>gacutil -i System.Reflection.Metadata.dll
Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Assembly successfully added to the cache

Open my solution again and it works! It might be not the best solution, but it works and I don’t have to reinstall VS2015, so I won’t complain.

Things I wish I knew before playing The Witcher 3: Wild Hunt

The game was released 1 year ago – still – it’s a masterpiece to be played. If you’ve never played it, play it now – it’s easily one of the best games in years, if not decades. The storyline with twists will keep you thinking in a while (no decision is clearly better or worse, and your choices will definitely make impacts on the ending), while the graphic is still one of best in any games, and the gameplay will keep you excited. If you played it – it’s now time to replay it, with new expansions, Heart of Stones and Blood and Wine. They are some of best expansions ever released.

The Witcher 3: Wild Hunt

Truth be told, I was new to The Witcher and Wild Hunt was the first game I played in the series. Now I’m playing it again and sometimes I feel really stupid for not knowing something earlier – thing might have been much easier in my first play.

Continue reading “Things I wish I knew before playing The Witcher 3: Wild Hunt”

Git in easy steps – branch

This is the third part in a series

Git in easy steps – the basic

Git in easy steps – amend and stash

Git in easy steps – branch

Then what is a branch in Git, actually? A branch in Git is simply pointer to the hash of a commit (which will be the HEAD commit of that branch), and a name of your branch, of course. That means creating a branch in Git is extremely cheap and is almost instantous.

Now if you look back at the branch tree in Git Extensions, you will see a linear tree. (It’s not something you usually see in your working environment, but we’re new anyway.). You can see that the name of the branches and the commit message are in bold.

For the commit, it means the commit is the HEAD commit of a active branch. A commit will always point to it parent (or its parents, in case of a merge). When you know the HEAD commit, you can know how does your branch look like, down to the initial commit (which has no parent).

Continue reading “Git in easy steps – branch”

Learn Git in … 30 days

Recently I stumbled on a tutorial named Learn git in 30 minutes. While there is nothing wrong with that tutorial, it’s actually pretty accurate, and clear and easy to follow – thumbs up to the author about the writing – I have great concerns about how should we learn Git.

Git is not that easy.

Don’t get me wrong, Git is a great tool, perhaps the greatest developers’ tool since C language. Where I work at, we switched from Team Foundation Server to Git two years and a half ago, and I’ve never looked back – Git does things right where TFS did wrong. It really helped my life, as a developer, easier.

But everything comes at a cost.

As powerful and flexible as it is, Git is also complex and easy to mess up. It can be your best tool,  but it can also be your worst nightmare, when something goes wrong.

Continue reading “Learn Git in … 30 days”

Unable to import .bacpac files exported from Azure

Update: I found a faster, more reliable way to import, here

Today when I tried to import a .bacpac file from a customer, I ran across this issue:

Could not load schema model from package. (Microsoft.SqlServer.Dac)

——————————
ADDITIONAL INFORMATION:

Internal Error. The internal target platform type Sql120DatabaseSchemaProvider does not support schema file version ‘2.6’. (File: D:\supportcases\something.bacpac) (Microsoft.Data.Tools.Schema.Sql)

I’m using SQL Server 2014, Developer edition. Searching for the error returns no matched result. However, as the file was exported by Azure v12, we can assume Microsoft should have done something to support the latest version (2.6) in Management Studio.

Continue reading “Unable to import .bacpac files exported from Azure”

Configure Apache with Load-balancer / Proxy

If your Apache website is under a load-balancer or proxy, some features might not work very well. The proxy, for example, might “hide” the true IP from clients, the address your application sees in REMOTE_ADDR attribute (PHP, for example) will be the IP of the proxy renders IP-ban in .htaccess useless.

If such things happen, time to do some configuration. First, you need to enable the mod_remoteip module to handle requests through a proxy. It will allow you to “rewrite” some headers in the request to make your web application to know the true client IP.

Continue reading “Configure Apache with Load-balancer / Proxy”