Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
shane_spencer
Specialist
Specialist

High Page File Usage

I've been given the unenviable task of support a QlikView environment that I didn't build and with very little background in QlikView.

After only a few weeks the users are complaining of performance problems.

I've had a look at the Perfomance Metrics and when (Memory) Committed Bytes In Use (%) gets over 90% we start to see the Page File being increasing used, which is an obvious problem.

I found this rather good document: DS-Technical-Brief-QlikView-Server-Memory-Management-and-CPU-Utilization-EN.pdf that discusses the Working Set and Paging etc.

Our Working Set Min is 90% and Max 97%

Our QVS Servers are a clusterd pair with 192GB of RAM

These servers are pretty large already so there's a limit to how much more memory I can add, plus I don't want to simply throw hardware at the problem without understanding it.

My question is if I reduce the Working Set Min (and Max) will QVS start managing it's use of memory (clearing cache etc as described in the above pdf) and prevent Paging, or as I fear will the servers simply start Paging at a lower overall Memory Usage?

21 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Shane,

Just to throw in my two cents. It's important to understand that Qlikview Server will never deliver a good user experience if the QVS task is paging at all. It all has to live in RAM to give good performance. So as you've stated you need to either increase available RAM or decrease the RAM demand of the apps.

Confirm a couple of things --

1. Are there apps other than QV running on this box?

2. Are reloads being done on this box or another server?

To answer your original question. If you reduce the WS Max, you will begin paging sooner. If you reduce the WS Min, you should not begin paging sooner. However, you will begin cache trimming sooner, which may be a good thing but probably won't resolve your overall problem.

If you analyze the QV documents, you may find that one or two are contributing to the bulk of the RAM usage and those would be the best tuning candidates.

-Rob

shane_spencer
Specialist
Specialist
Author

Hi Rob

Thanx for your reply. It's actually a clustered environment. There's 2 load balanced servers acting as the QVS servers, and one of these acts as the web server too and those are the ones with the occasional high paging. There's a 3rd server (I forget the description) but that does all the other stuff like reloads etc.

You're confirming what I had considered, there's a reason why the data is in memory so if we start trimming sooner then it could just change the nature of the problem if the users need to recall or recreate the data that was trimmed.

As I say my backgrond is performance management, not QlikView so I want to eliminated environmental / config constraints before I go back to the developers and start looking at the documents.

Once again thanx.

Shane

davidmc1
Contributor II
Contributor II

Hellow Shane, i have the same problem. Did you get any conclusion? is there any qliktech suggestion about the configuration of pagefile?

I think that you have detailed that qvs is swapping at wsl threshold, this is not working as designed (in the theory i know) and i think i have the same behaviour on qvs 11.2 sr5.

Cheers.

shane_spencer
Specialist
Specialist
Author

Hi David, our issue was that we were on v10 r4 and were experiencing memory leaks - in brief after a reload a second document remained in memory and could not be flushed hence when we hit wsl we started paging. We've upgraded to v11 sr2 and memory leaks are much less frequent though they sometimes do occur. Some people will tell you that QlikView does not have memory leaks but they're mistaken, unfortunately many people report normal behaviour as memory leaks because they don't understand qlikview which gives those who claim Qlikview does not experience memory leaks credence.

The chances are though that you just need to configure your environment and are not experiencing a true issue with QlikView, so the onus is on you to do some analysis and tweaking. You need to start monitoring QVS process to see how it grows and understand if you've got enough RAM for all your documents - they'll be 4.25x as big in Memory as on disk. Then you'll need more RAM for cached results so you need to understand how quickly that gets depleted with user activity. Depending on the size of your environment you may wish to alter the working set low - we're currently at 92% and 96% but with 288GB of RAM. This allows about 22GB of RAM for processes other than QVS. This was a figure arrived at after analysis of usage, not guess work.

What's important is that you understand what else is consuming memory. If publisher is on the same server then QVB process(es) will be directly competing for RAM with QVS and paging will occur long before hitting working set low. If that's the case you may wish to have a separate publisher.

i.e.

You should monitor QVB process(es) sizes when tasks are running and see if they are consuming more RAM then the server has got hence use Pagefile. We have a process that runs once a month that consumers about 120GB and the server is 100GB but as we have a separate Publisher and it's only once a month for 2 hours it's not worth investing in more hardware.

Take a look at these 2 documents on how to use Perfmon to monitor QlikView usage:

How to set up Windows Performance Monitor For QlikView Servers

QlikView Performance Monitoring

n.b. There's no configuring of Pagefile that you need to do, you need to configure your environment to avoid using it if possible,

davidmc1
Contributor II
Contributor II

Thank you very much Shane, you have made a great analysis and tuning job. And thank you so much for sharing it with us.

I've also seen that some times our memory leaks were caused by a big distribution, we have some gigantic documents, and i have leave between the wsl and the wsh enough RAM free in order to accommodate the new version "without pagin".

We have two dedicated publisher and twelve qvs/qvws distributed in three cluster in our production environment, so qvb is not competing for the resources.

The behaviour that i have seen is that qvs begins writting working set beyond parameters, it stays days in that state and it also stops working.

The theory we know,  is that once the wsl is reached, qvs begins to remove cached aggregation and objects from RAM in order to decrease the ws below the threshold. Also in theory the OS is asked not to page below this level.

We have seen at qvs logs that it stay's with that message for days, and with the data of the qvs performance log, it seems that it doesn't remove anything from ram. So i think this could a be product bug still in 11.2 sr5: not to flush cached aggregation correctly and not pagin under wsh.

You have explained very accurately the moment that you saw that qvs begins swapping i don't know how you did it.. I don't have experience analizing memory consumption on windows. Could you help me about this?

I don't understand rightly the metrics that qlikview shows, i think they doesn't match with the OS statistics. For example the value VMCommitted that has this definition at qmc help
"Size in MB of virtual memory actually used by QlikView Server at the end of the interval. This number is part of VMAllocated(MB) and should not exceed the size of the physical memory in order to avoid unacceptable response times." doesnt match with the workingset value of the process at resource monitor (maybe because this is just phisycal memory), but i have also see that perfmon the \Paging File(*)\% Usage performance counter is too low to be the other part of that value. I don't know how see the swapping use correctly.

I also think that one of our problems is that we have system managed page file, and it has the same size that the RAM. That's why i'm looking for a vendor guidelines on how to configure this setting, i have only a v10 pdf that indicates 150% of RAM size, and i also think that QlikView is an in memory product that must live only in RAM. So what size have you leave to the pagefile? i was thinking about 8gb's for S.O.

Thank you very much,

cheers

shane_spencer
Specialist
Specialist
Author

From my experience the difference between wsl and wsh has no relevance. It's the wsl figure that is key.

We have an application that reloads every night. When the reload is complete the new versions gets distributed then loaded in Memory to replace the old version. However more often than not the older versions does not drop out of memory (even though only allow 1 version in memory is enabled). i.e.

This extra document cannot be flushed from cache like the "cached results" therefore the system starts paging when we reach wsl. We've got a case open with Qlik since January, we were able to prove this was a genuine memory leak (as the only system activity is reload at this time) and we provided them with a document so they were able to recreate the issue, however they still have come up with a fix. Therefore we schedule regular restarts of QVS to avoid running out of memory.

My advice would be to ignore the QlikView Performance Logs and instead set up windows perfmon monitoring as per above links. Collect and look at the following 3:

\Paging File(_Total)\% Usage

\Memory\Available MBytes

\Process(qvs)\Private Bytes

When Paging % Usage starts growing you want to compare that to how many Avail MBytes you have left and the size of QVS in Private Bytes. If you've run out of 'Avail MBytes' when paging occurs then your WSL us too high, if you've got plenty (i.e. more than 5GB) spare then adjust your WSL upwards.

n.b. The '% Committed Bytes In Use' metrics combines RAM and Paging file so if you don't understand this and know the size of your paging file it can be misleading.

We also have system managed page file, this is the best way to go. However what you want to do is avoid using paging file totally for QlikVIew (and not worry about how big it is set to). You really need to understand your application and how it consumes memory over time - for example our 10-12 documents have a base footprint of 80-100GB and at peak times we consumer 40GB an hour with cached results etc and when we reach WSL Qlikview becomes unpredictable so we have cache flushes and recycles to avoid hitting that point.


If you've got a large document (in Memory) you don't want to be at wsl when it has finished reloading. QlikView does not seem to cope well with loading a document int o Memory and flushing cache at the same time.

davidmc1
Contributor II
Contributor II

Hi Shane!

In our case the difference is relevant because of our XL documents.

Our behaviour is a little bit different than yours, memory doesn´t grows so qickly, at least at performance log. I have also a case opened since June, i will told you if i get something interesting and please let me know if they give you a fix.

Thank you very much for the explanation of the perfmon, yesterday i also have been studing the get-process and finally i focus on the PagedMemorySize64 and PagedSystemMemorySize64 properties. I will put the eye also on the metrics you say.

Just one question, when you say "we have cache flushes and recycles to avoid hitting that point" what you exactly mean? just restarting qvs or is there a best way?

cheers.

shane_spencer
Specialist
Specialist
Author

There's a line you can put in the settings.ini to flush cache.

C:\ProgramData\QlikTech\QlikViewServer\settings.ini

Update the "Within the [Settings 7] configuration section" with the entry:

ClearCacheTimesPerDay=1

Qlik don't recommend a frequency of more than 3/4 and to be honest I would avoid using it. What you can do instead is recycle QVS using a bat file trigger by a windows scheduled task. Copy and paste the below in to a ".bat" file:

:stop

sc stop QlikViewServer

ping 127.0.0.1 -n 120 -w 1000 > nul

sc query QlikViewServer | find /i "STATE" | find "STOPPED"

if errorlevel 1 goto :stop

goto :start

:start

net start | find /i "QlikViewServer">nul && goto :loop

sc start QlikViewServer

davidmc1
Contributor II
Contributor II

I will use it, and i want to know more about clearcache entry and values that it support...

Great stuff, thans a lot for your time and for sharing all of this.

shane_spencer
Specialist
Specialist
Author

The clear cache setting is what Qlik refer to as an Easter Egg, it's additional functionality that's not supported. You cannot set times to clear cache just frequency. i.e. 1 = Midnight GMT, 2 = Midnight & Midday GMT, 3 = Midnight, 8am and 4pm GMT, etc.

It works well at midnight when the system has no users, but is less successful at midday when it's busy. I suspect that it may also be causing instability so I'm looking at moving away from it as an option. I suggest you carefully monitor for issues if you do implement it.