1. 02 May, 2020 1 commit
    • zhenwei pi's avatar
      Support setcpuaffinity on linux/bsd · 1a0deab2
      zhenwei pi authored
      Currently, there are several types of threads/child processes of a
      redis server. Sometimes we need deeply optimise the performance of
      redis, so we would like to isolate threads/processes.
      
      There were some discussion about cpu affinity cases in the issue:
      https://github.com/antirez/redis/issues/2863
      
      
      
      So implement cpu affinity setting by redis.conf in this patch, then
      we can config server_cpulist/bio_cpulist/aof_rewrite_cpulist/
      bgsave_cpulist by cpu list.
      
      Examples of cpulist in redis.conf:
      server_cpulist 0-7:2      means cpu affinity 0,2,4,6
      bio_cpulist 1,3           means cpu affinity 1,3
      aof_rewrite_cpulist 8-11  means cpu affinity 8,9,10,11
      bgsave_cpulist 1,10-11    means cpu affinity 1,10,11
      
      Test on linux/freebsd, both work fine.
      Signed-off-by: default avatarzhenwei pi <pizhenwei@bytedance.com>
      1a0deab2
  2. 20 Apr, 2020 1 commit
    • antirez's avatar
      Implement redis_set_thread_title for MacOS. · c7db333a
      antirez authored
      Strange enough, pthread_setname_np() produces a warning for not defined
      function even if pthread is included. Moreover the MacOS documentation
      claims the return value for the function is void, but actually is int.
      
      Related to #7089.
      c7db333a
  3. 18 Apr, 2020 1 commit
    • zhenwei pi's avatar
      Threaded IO: set thread name for redis-server · 5010da6a
      zhenwei pi authored
      
      
      Set thread name for each thread of redis-server, this helps us to
      monitor the utilization and optimise the performance.
      
      And suggested-by Salvatore, implement this feature for multi
      platforms. Currently support linux and bsd, ignore other OS.
      
      An exmaple on Linux:
       # top -d 5 -p `pidof redis-server ` -H
      
          PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND
      3682671 root      20   0  227744   8248   3836 R 99.2  0.0   0:19.53 redis-server
      3682677 root      20   0  227744   8248   3836 S 26.4  0.0   0:04.15 io_thd_3
      3682675 root      20   0  227744   8248   3836 S 23.6  0.0   0:03.98 io_thd_1
      3682676 root      20   0  227744   8248   3836 S 23.6  0.0   0:03.97 io_thd_2
      3682672 root      20   0  227744   8248   3836 S  0.2  0.0   0:00.02 bio_close_file
      3682673 root      20   0  227744   8248   3836 S  0.2  0.0   0:00.02 bio_aof_fsync
      3682674 root      20   0  227744   8248   3836 S  0.0  0.0   0:00.00 bio_lazy_free
      3682678 root      20   0  227744   8248   3836 S  0.0  0.0   0:00.00 jemalloc_bg_thd
      3682682 root      20   0  227744   8248   3836 S  0.0  0.0   0:00.00 jemalloc_bg_thd
      3682683 root      20   0  227744   8248   3836 S  0.0  0.0   0:00.00 jemalloc_bg_thd
      3682684 root      20   0  227744   8248   3836 S  0.0  0.0   0:00.00 jemalloc_bg_thd
      3682685 root      20   0  227744   8248   3836 S  0.0  0.0   0:00.00 jemalloc_bg_thd
      3682687 root      20   0  227744   8248   3836 S  0.0  0.0   0:00.00 jemalloc_bg_thd
      
      Another exmaple on FreeBSD-12.1:
        PID USERNAME    PRI NICE   SIZE    RES STATE    C   TIME    WCPU COMMAND
       5212 root        100    0    48M  7280K CPU2     2   0:26  99.52% redis-server{redis-server}
       5212 root         38    0    48M  7280K umtxn    4   0:06  26.94% redis-server{io_thd_3}
       5212 root         36    0    48M  7280K umtxn    6   0:06  26.84% redis-server{io_thd_1}
       5212 root         39    0    48M  7280K umtxn    1   0:06  25.30% redis-server{io_thd_2}
       5212 root         20    0    48M  7280K uwait    3   0:00   0.00% redis-server{redis-server}
       5212 root         21    0    48M  7280K uwait    2   0:00   0.00% redis-server{bio_close_file}
       5212 root         21    0    48M  7280K uwait    3   0:00   0.00% redis-server{bio_aof_fsync}
       5212 root         21    0    48M  7280K uwait    0   0:00   0.00% redis-server{bio_lazy_free}
      Signed-off-by: default avatarzhenwei pi <pizhenwei@bytedance.com>
      5010da6a
  4. 25 Nov, 2018 2 commits
  5. 15 Mar, 2018 1 commit
  6. 23 Feb, 2017 1 commit
  7. 19 Feb, 2017 2 commits
  8. 10 Feb, 2015 1 commit
  9. 07 Feb, 2015 1 commit
  10. 03 Feb, 2015 1 commit
  11. 11 Dec, 2014 1 commit
  12. 04 Dec, 2014 1 commit
  13. 08 Aug, 2014 1 commit
  14. 26 Jun, 2014 1 commit
    • Matt Stancliff's avatar
      Allow __powerpc__ to define HAVE_ATOMIC too · a3e7a665
      Matt Stancliff authored
      From mailing list post https://groups.google.com/forum/#!topic/redis-db/D3k7KmJmYgM
      
      In the file “config.h”, the definition HAVE_ATOMIC is used to indicate
      if an architecture on which redis is implemented supports atomic
      synchronization primitives.  Powerpc  supports atomic synchronization
      primitives, however, it is not listed as one of the architectures
      supported in config.h. This patch  adds the __powerpc__ to the list of
      architectures supporting these primitives. The improvement of redis
      due to the atomic synchronization on powerpc is significant,
      around 30% to 40%, over the default implementation using pthreads.
      
      This proposal adds __powerpc__ to the list of architectures designated
      to support atomic builtins.
      a3e7a665
  15. 07 May, 2014 1 commit
  16. 27 Feb, 2013 1 commit
    • Stam He's avatar
      Set proctitle: avoid the use of __attribute__((constructor)). · 9c8be6ca
      Stam He authored
      This cased a segfault in some Linux system and was GCC-specific.
      
      Commit modified by @antirez:
      
      1) Stripped away the part to set the proc title via config for now.
      2) Handle initialization of setproctitle only when the replacement
         is used.
      3) Don't require GCC now that the attribute constructor is no
         longer used.
      9c8be6ca
  17. 26 Feb, 2013 1 commit
    • antirez's avatar
      Set process name in ps output to make operations safer. · 6356cf68
      antirez authored
      This commit allows Redis to set a process name that includes the binding
      address and the port number in order to make operations simpler.
      
      Redis children processes doing AOF rewrites or RDB saving change the
      name into redis-aof-rewrite and redis-rdb-bgsave respectively.
      
      This in general makes harder to kill the wrong process because of an
      error and makes simpler to identify saving children.
      
      This feature was suggested by Arnaud GRANAL in the Redis Google Group,
      Arnaud also pointed me to the setproctitle.c implementation includeed in
      this commit.
      
      This feature should work on all the Linux, OSX, and all the three major
      BSD systems.
      6356cf68
  18. 21 Jan, 2013 1 commit
    • antirez's avatar
      Not every __sun has backtrace(). · cd892d01
      antirez authored
      I don't know how to test for Open Solaris that has support for
      backtrace() so for now removing the #ifdef that breaks compilation under
      other Solaris flavors.
      cd892d01
  19. 11 Dec, 2012 1 commit
    • antirez's avatar
      Fix config.h endianess detection to work on Linux / PPC64. · 705874e3
      antirez authored
      Config.h performs endianess detection including OS-specific headers to
      define the endianess macros, or when this is not possible, checking the
      processor type via ifdefs.
      
      Sometimes when the OS-specific macro is included, only __BYTE_ORDER is
      defined, while BYTE_ORDER remains undefined. There is code at the end of
      config.h endianess detection in order to define the macros without the
      underscore, but it was not working correctly.
      
      This commit fixes endianess detection fixing Redis on Linux / PPC64 and
      possibly other systems.
      705874e3
  20. 21 Nov, 2012 1 commit
  21. 08 Nov, 2012 1 commit
  22. 26 Oct, 2012 1 commit
  23. 25 Oct, 2012 2 commits
  24. 28 Aug, 2012 1 commit
    • antirez's avatar
      Incrementally flush RDB on disk while loading it from a master. · 784b9308
      antirez authored
      This fixes issue #539.
      
      Basically if there is enough free memory the OS may buffer the RDB file
      that the slave transfers on disk from the master. The file may
      actually be flused on disk at once by the operating system when it gets
      closed by Redis, causing the close system call to block for a long time.
      
      This patch is a modified version of one provided by yoav-steinberg of
      @garantiadata (the original version was posted in the issue #539
      comments), and tries to flush the OS buffers incrementally (every 8 MB
      of loaded data).
      784b9308
  25. 15 May, 2012 1 commit
  26. 11 Apr, 2012 1 commit
  27. 26 Feb, 2012 2 commits
  28. 21 Feb, 2012 1 commit
  29. 20 Jun, 2011 1 commit
  30. 05 May, 2011 2 commits
  31. 09 Mar, 2011 2 commits
  32. 23 Oct, 2010 2 commits
  33. 02 Sep, 2010 1 commit