At work we have the situation of a slow application. The vendor of the custom application insists that the ZFS (Solaris 10u8) and the Oracle DB are badly tuned for the application. Part of their tuning is to limit the ARC to 1 GB (our max size is 24 GB on this machine). One problem we see is that there are many write operations (rounded values: 1k ops for up to 100 MB) and the DB is complaining that the logwriter is not able to write out the data fast enough. At the same time our database admins see a lot of commits and/or rollbacks so that the archive log grows very fast to 1.5 GB. The funny thing is… the performance tests are supposed to only cover SELECTs and small UPDATEs.
I proposed to reduce the zfs_txg_timeout from the default value of 30 to some seconds (and as no reboot is needed like for the max arc size, this can be done fast instead of waiting some minutes for the boot-checks of the M5000). The first try was to reduce it to 5 seconds and it improved the situation. The DB still complained about not being able to write out the logs fast enough, but it did not do it as often as before. To make the vendor happy we reduced the max arc size and tested again. First we have not seen any complains from the DB anymore, which looked strange to me because my understanding of the ARC (and the description of the ZFS Evil Tuning Guide regarding the max size setting) suggest that this should not show this behavior we have seen, but the machine was also rebooted for this, so there could also be another explanation.
Luckily we found out that our testing infrastructure had a problem so that only a fraction of the performance test was performed. This morning the people responsible for that made some changes and now the DB is complaining again.
This is what I expected. To make sure I fully understand the ARC, I had a look at the theory behind it at the IBM research center (update: PDF link). There are some papers which explain how to extend a cache which uses the LRU replacement policy with some lines of code to an ARC. It looks like it would be an improvement to have a look at which places in FreeBSD a LRU policy is used to test if an ARC would improve the cache hit rate. From reading the paper it looks like there are a lot of places where this should be the case. The authors also provide two adaptive extensions to the CLOCK algorithm (used in various OS in the VM subsystem) which indicate that such an approach could be beneficial for a VM system. I already contacted Alan (the FreeBSD one) and asked if he knows about it and if it could be beneficial for FreeBSD.
loading…
loading…
Tags: arc, custom application, max size, oracle db, pdf link, performance test, performance tests, rollbacks, slow application, tuning guide, zfs solaris —


April 15th, 2010 at 11:40
[…] post rapide pour vous signaler sur le blog d’Alexander, un post traitant de la configuration de l’AdaptativeReplacement Cache (ARC) pour ZFS et […]
April 21st, 2010 at 08:34
ARC is patented by IBM resulting in the open-source community being reluctant to adopt it. PostgreSQL has a thread on their concerns. The LIRS policy was adopted by MySql and seems to be a strong contender without legal issues. I am in the midst of implementing it in my ConcurrentLinkedHashMap project (Java) and find it complicated but quite efficient. Both can be implemented cheaply with great results, but are a more complex than a simple LRU policy.
loading...
loading...
April 21st, 2010 at 08:59
Does someone know if the ARC is part of the patent portfolio for which IBM allows the use in OpenSource code? If yes, this would allow to offer it as a compile-time alternative.
I have read about the concerns of the PostgreSQL people (document from 2005), but have not seen a reference to an explanation of their alternative. Googling for “LIRS policy” gives a link to a paper from 2002 in the ACM portal. Just by reading the abstract, it seems to be an alternatie to LRU(-K), but not to the CLOCK algorithm. Do you know about some performance benchmarks with LIRS and ARC? I would expect that ARC can still outperform LIRS for frequently accessed pages.
loading...
loading...
April 23rd, 2010 at 02:34
LIRS takes both recency and frequency into account. The concurrent variant of LIRS is ClockPro. The buffering approach used in my CLHM provides allows non-concurrent policies like LRU and LIRS to not suffer from lock contention, so the most efficient policy can be used. LIRS is an O(1) algorithm. The full paper is at [1].
Another paper [2] benchmarks multiple page replacement policies. LIRS performed extremely well.
I have only seen ARC used where there is an obvious cross-licensing agreement with IBM. However, I doubt that anyone has put much effort into determining if its usable and instead adopted alternative approaches.
[1] http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.2.437
[2] http://people.cs.vt.edu/~butta/docs/sigmetrics05_kernelPrefetch.pdf
loading...
loading...