Skip to content

Instantly share code, notes, and snippets.

@methane
Created April 30, 2012 06:51
Show Gist options
  • Select an option

  • Save methane/2556093 to your computer and use it in GitHub Desktop.

Select an option

Save methane/2556093 to your computer and use it in GitHub Desktop.
fluentd で殴り合い
<source>
type forward
port 12345
</source>
<match **>
type forward
buffer_type memory
buffer_chunk_limit 4m
buffer_queue_limit 128
flush_interval 1s
<server>
host localhost
port 12346
</server>
</match>
<source>
type forward
port 12346
</source>
<match **>
type forward
buffer_type memory
buffer_chunk_limit 4m
buffer_queue_limit 128
flush_interval 1s
<server>
host localhost
port 12345
</server>
</match>
import msgpack
import subprocess
data = msgpack.packb({"foo": "a"*10000})
proc = subprocess.Popen('fluent-cat -p12345 --msgpack foo.bar', shell=True, stdin=subprocess.PIPE)
proc.stdin.write(data*10000)
proc.stdin.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment