github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

nealrichter / tokyotyrant_rsshack

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 3
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Implement memory cap for tokyocabient and tokyotyrant — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

add comment on libproc code 
nealrichter (author)
Mon Nov 02 16:05:38 -0800 2009
commit  3ab4fdd9a4883e53b611dd3308ff9fa20f723837
tree    3a4aede22bb7b8fc4e361866dc6b2055b8b72fbb
parent  bf7087b10c40a43daf604506f6e38abf9b192224
tokyotyrant_rsshack /
name age
history
message
file Makefile.TT.libproc Mon Oct 12 09:17:29 -0700 2009 initial commit of rsshack for TT [nealrichter]
file README Mon Nov 02 16:05:38 -0800 2009 add comment on libproc code [nealrichter]
file tc_1_4_34_rss_management.patch Mon Oct 12 09:17:29 -0700 2009 initial commit of rsshack for TT [nealrichter]
directory tokyocabinet-1.4.17/ Tue Oct 13 12:22:34 -0700 2009 add patch for tc 1.4.17 [nealrichter]
directory tokyocabinet-1.4.34/ Loading commit data...
README
Neal's quick hack at Memory management inside Tokyo Cabinet

Essentially I added:
 * rssgoal parameter as peer of lcnode/ncnode
 * uses libproc to get RSS memory size
 * change to tcbdbcacheadjust() to proportionally adjust down leafc
and nodec
 * if actual memory usage is 10% higher than the goal via standard
methods in tcbdbcacheadjust()

  Example usage w/ 2.3 Gig:
#nmemb=256#ncnum=10240#lmemb=512#lcnum=65536#bnum=100000000#xmsiz=536870912#rssgoal=2300000000#opts=l

 Still in testing.  Results inconclusive due to repeated server
crashes .. I attempted to substitute this version of tc for a current
older running version.  That might cause crashes. 

This is a work-in-progress so the build modification are not integrated into 'configure' inputs.

Build instructions
1) wget http://1978th.net/tokyocabinet/tokyocabinet-1.4.34.tar.gz
2) wget http://1978th.net/tokyotyrant/tokyotyrant-1.1.35.tar.gz
3) locate proc/readproc.h 
    - if it doesn't exist install it
    - standard headers for libproc.so
4) tar xvfz both tarballs
5) apply the patch to tokyocabinet-1.4.34
   patch -p0 < tc_1_4_34_rss_management.patch
6) configure and make as normal - will error on link
7) make -f Makefile.TC.libproc
8) configure and make tokyotyrant as normal - will error on link
9) make -f Makefile.TT.libproc
10) Install ttserver_rsshack, libtokyotyrant_rsshack.so.3 & libtokyocabinet_rsshack.so.8 in the normal places
11) ldd libtokyocabinet_rsshack.so.8
  libbz2.so.1 => /usr/lib64/libbz2.so.1 (0x00002ba0f91f9000)
  libz.so.1 => /usr/lib64/libz.so.1 (0x00002ba0f9409000)
  librt.so.1 => /lib64/librt.so.1 (0x00002ba0f961d000)
  libpthread.so.0 => /lib64/libpthread.so.0 (0x00002ba0f9827000)
  libm.so.6 => /lib64/libm.so.6 (0x00002ba0f9a41000)
  libc.so.6 => /lib64/libc.so.6 (0x00002ba0f9cc4000)
  libproc-3.2.7.so => /lib64/libproc-3.2.7.so (0x00002ba0fa013000)
  /lib64/ld-linux-x86-64.so.2 (0x0000555555554000)
12) ldd ttserver_rsshack 
  libtokyotyrant_rsshack.so.3 => /usr/local/lib/libtokyotyrant_rsshack.so.3 (0x00002ab055cd6000)
  libtokyocabinet_rsshack.so.8 => /usr/local/lib/libtokyocabinet_rsshack.so.8 (0x00002ab055eed000)
  libbz2.so.1 => /usr/lib64/libbz2.so.1 (0x00002ab05616c000)
  libz.so.1 => /usr/lib64/libz.so.1 (0x00002ab05637d000)
  libresolv.so.2 => /lib64/libresolv.so.2 (0x00002ab056591000)
  libnsl.so.1 => /lib64/libnsl.so.1 (0x00002ab0567a6000)
  libdl.so.2 => /lib64/libdl.so.2 (0x00002ab0569be000)
  librt.so.1 => /lib64/librt.so.1 (0x00002ab056bc2000)
  libpthread.so.0 => /lib64/libpthread.so.0 (0x00002ab056dcb000)
  libm.so.6 => /lib64/libm.so.6 (0x00002ab056fe6000)
  libc.so.6 => /lib64/libc.so.6 (0x00002ab057269000)
  libproc-3.2.7.so => /lib64/libproc-3.2.7.so (0x00002ab0575b7000)
  /lib64/ld-linux-x86-64.so.2 (0x00002ab055abb000)

It should be trivial to extract the code/functions from libproc to remove the dependency on librproc.  libproc's 
get_proc_stats() 
reads and parses the /proc/[PID] file to fill a proc_t struct.  This would be a bit cleaner...
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server