Kafka Producer Performance Optimization

When we are talking about performance of Kafka Producer, we are really talking about two different things: latency: how much time passes from the time KafkaProducer.send() was called until the message shows up in a Kafka broker. throughput: how many messages can the producer send to Kafka each second. Many years ago, I was in […]

Zookeeper log cleanup script

The following is a shell script that clears three zookeeper nodes (making it a scheduled task): zookeeper home Zkdir=/server/app/zookeeper-3.4.6 snapshot file dir snapDir=/mnt/data/zookeeper/n_1 snapDir2=/mnt/data/zookeeper/n_2 snapDir3=/mnt/data/zookeeper/n_3 tran log dir dataDir=/mnt/data/zookeeper/n_1 dataDir2=/mnt/data/zookeeper/n_2 dataDir3=/mnt/data/zookeeper/n_3 Leave 30 files Count=15 Cd /server/app/zookeeper-3.4.6 Java -cp ${zkdir}/zookeeper-3.4.6.jar:${zkdir}/lib/slf4j-api-1.6.1.jar:${zkdir}/lib/slf4j-log4j12-1.6.1.jar: ${zkdir}/lib/log4j-1.2.16.jar:${zkdir}/conf org.apache.zookeeper.server.PurgeTxnLog ${dataDir} ${snapDir} -n ${count} Java -cp ${zkdir}/zookeeper-3.4.6.jar:${zkdir}/lib/slf4j-api-1.6.1.jar:${zkdir}/lib/slf4j-log4j12-1.6.1.jar: ${zkdir}/lib/log4j-1.2.16.jar:${zkdir}/conf org.apache.zookeeper.server.PurgeTxnLog ${dataDir2} ${snapDir2} -n ${count} […]

Apache AB tools

Ab is a very good stress test tool of apache. When apache is installed, you can find ab under bin. We can simulate 100 concurrent users and send 1000 requests to a page.as follow: ./ab -n1000 -c100 http://mytest.com/a.html Where -n represents the number of requests and -c represents the number of concurrent   Return results: […]