All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] memcg async reclaim v2
@ 2011-05-20  3:37 ` KAMEZAWA Hiroyuki
  0 siblings, 0 replies; 49+ messages in thread
From: KAMEZAWA Hiroyuki @ 2011-05-20  3:37 UTC (permalink / raw)
  To: linux-mm
  Cc: linux-kernel, nishimura, balbir, Ying Han, hannes, Michal Hocko, akpm


Since v1, I did some brush up and more tests.

main changes are
  - disabled at default
  - add a control file to enable it
  - never allow enabled on UP machine.
  - don't writepage at all (revisit this when dirty_ratio comes.)
  - change handling of priorty and total scan, add more sleep chances.

But yes, maybe some more changes/tests will be needed and I don't want to
rush before next kernel version.

IIUC, what pointed out in previous post was "show numbers". Because this kind of
asyncronous reclaim just increase cpu usage and no help to latency, just makes
scores bad.

I tested with apatch bench in following way.

  1. create cgroup /cgroup/memory/httpd
  2. move httpd under it
  3. create 4096 files under /var/www/html/data
     each file's size is 160kb.
  4. prepare a cgi scipt to acess 4096 files in random as
  ==
  #!/usr/bin/python
  # -*- coding: utf-8 -*-

  import random

  print "Content-Type: text/plain\n\n"

  num = int(round(random.normalvariate(0.5, 0.1) * 4096))
  filename = "/var/www/html/data/" + str(num)

  with open(filename) as f:
         buf = f.read(128*1024)
  print "Hello world  " + str(num) + "\n"
  ==
  This reads random file and returns Hello World. I used "normalvariate()"
  for getting normal distribution access to files.

  By this, 160kb*4096 files of data is accessed in normal distribution.

  5. access files by apatch bench
     # ab -n 40960 -c 4 localhost:8080/cgi-bin/rand.py
 
  This access files 40960 times with concurrency 4.
  And see latency under memory cgroup.

  I run apatch bench 3 times for each test and following scores are score of
  3rd trial, we can think file cache is in good state....
  (But number other than "max" seems to be stable.)

  Note: httpd and apache bench runs on the same host.

A) No limit.

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       2
Processing:    30   32   1.5     32     123
Waiting:       28   31   1.5     31     122
Total:         30   32   1.5     32     123

Percentage of the requests served within a certain time (ms)
  50%     32
  66%     32
  75%     32
  80%     33
  90%     33
  95%     33
  98%     34
  99%     35
 100%    123 (longest request)

If no limit, most of access can be end around 32msecs. After this, I saw
memory.max_usage_in_bytes as mostly 600MB.


B) limit to 300MB and disable async reclaim.

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       1
Processing:    29   35  35.6     31    3507
Waiting:       28   34  33.4     30    3506
Total:         30   35  35.6     31    3507

Percentage of the requests served within a certain time (ms)
  50%     31
  66%     32
  75%     32
  80%     32
  90%     34
  95%     43
  98%     89
  99%    134
 100%   3507 (longest request)

When set limit, "max" latency can take various big value but latency goes
bad. 

C) limit to 300MB and enable async reclaim.

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       2
Processing:    29   33   6.9     32     279
Waiting:       27   32   6.8     31     275
Total:         29   33   6.9     32     279

Percentage of the requests served within a certain time (ms)
  50%     32
  66%     32
  75%     33
  80%     33
  90%     37
  95%     42
  98%     51
  99%     59
 100%    279 (longest request)

It seems latency goes better and stable rather than test B).


If you want to see other numbers/tests, please let me know. set up is easy.

I think automatic asynchronous reclaim works effectively for some class of
applications and stabilize its work.

Thanks,
-Kame











^ permalink raw reply	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2011-05-25  5:52 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-20  3:37 [PATCH 0/8] memcg async reclaim v2 KAMEZAWA Hiroyuki
2011-05-20  3:37 ` KAMEZAWA Hiroyuki
2011-05-20  3:41 ` [PATCH 1/8] memcg: export zone reclaimable pages KAMEZAWA Hiroyuki
2011-05-20  3:41   ` KAMEZAWA Hiroyuki
2011-05-20  3:42 ` [PATCH 2/8] memcg: easy check routine for reclaimable KAMEZAWA Hiroyuki
2011-05-20  3:42   ` KAMEZAWA Hiroyuki
2011-05-20 21:49   ` Andrew Morton
2011-05-20 21:49     ` Andrew Morton
2011-05-20 23:57     ` Hiroyuki Kamezawa
2011-05-20 23:57       ` Hiroyuki Kamezawa
2011-05-20  3:43 ` [PATCH 0/8] memcg: clean up, export swapiness KAMEZAWA Hiroyuki
2011-05-20  3:43   ` KAMEZAWA Hiroyuki
2011-05-23 17:26   ` Ying Han
2011-05-23 17:26     ` Ying Han
2011-05-23 23:55     ` KAMEZAWA Hiroyuki
2011-05-23 23:55       ` KAMEZAWA Hiroyuki
2011-05-20  3:44 ` [PATCH 4/8] memcg: export release victim KAMEZAWA Hiroyuki
2011-05-20  3:44   ` KAMEZAWA Hiroyuki
2011-05-20  3:46 ` [PATCH 6/8] memcg asynchronous memory reclaim interface KAMEZAWA Hiroyuki
2011-05-20  3:46   ` KAMEZAWA Hiroyuki
2011-05-20 21:49   ` Andrew Morton
2011-05-20 21:49     ` Andrew Morton
2011-05-20 23:56     ` Hiroyuki Kamezawa
2011-05-20 23:56       ` Hiroyuki Kamezawa
2011-05-23 23:36       ` Ying Han
2011-05-23 23:36         ` Ying Han
2011-05-24  0:11         ` KAMEZAWA Hiroyuki
2011-05-24  0:11           ` KAMEZAWA Hiroyuki
2011-05-24  0:26           ` Ying Han
2011-05-24  0:26             ` Ying Han
2011-05-20  3:47 ` [PATCH 7/8] memcg static scan reclaim for asyncrhonous reclaim KAMEZAWA Hiroyuki
2011-05-20  3:47   ` KAMEZAWA Hiroyuki
2011-05-20 21:50   ` Andrew Morton
2011-05-20 21:50     ` Andrew Morton
2011-05-21  0:23     ` Hiroyuki Kamezawa
2011-05-21  0:23       ` Hiroyuki Kamezawa
2011-05-20  3:48 ` [PATCH 8/8] memcg asyncrhouns reclaim workqueue KAMEZAWA Hiroyuki
2011-05-20  3:48   ` KAMEZAWA Hiroyuki
2011-05-20 21:51   ` Andrew Morton
2011-05-20 21:51     ` Andrew Morton
2011-05-21  0:41     ` Hiroyuki Kamezawa
2011-05-21  0:41       ` Hiroyuki Kamezawa
2011-05-21  1:26       ` Andrew Morton
2011-05-21  1:26         ` Andrew Morton
2011-05-23  0:25         ` KAMEZAWA Hiroyuki
2011-05-23  0:25           ` KAMEZAWA Hiroyuki
2011-05-25  5:51           ` Ying Han
     [not found] ` <BANLkTimd0CAqoAnuGz7WvKsbwphJxo0eZQ@mail.gmail.com>
2011-05-24  0:19   ` [PATCH 0/8] memcg async reclaim v2 KAMEZAWA Hiroyuki
2011-05-24  0:19     ` KAMEZAWA Hiroyuki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.