# Memcached performance

**URL:** <https://discuss.elastic.co/t/memcached-performance/182237>\
**Category:** Logstash\
**Created:** [May 22, 2019, 1:37pm UTC](https://discuss.elastic.co/t/memcached-performance/182237 "2019-05-22T13:37:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pastechecker](https://avatars.discourse-cdn.com/v4/letter/p/0ea827/32.png) [@pastechecker](https://discuss.elastic.co/u/pastechecker)\
**Post date:** [May 22, 2019, 1:37pm UTC](https://discuss.elastic.co/t/memcached-performance/182237/1 "2019-05-22T13:37:48Z")

</div>

Hello.  
As I have not encountered any post related to the memcached so far.

I have a very powerful machine, 512 GB of ram, RAID0 of SSD, 80 CPU cores of Xeon v4.... so the hardware is not the limit, potentially my misconfiguration.

My memcached settings are:

```
-d
logfile /var/log/memcached.log
# -v
-vv
-m 512
-p 11211
-u memcache
-l 127.0.0.1
-t 32
# -c 1024
# -k
# -M
# -r

# service memcached status
● memcached.service - LSB: Start memcached daemon
   Loaded: loaded (/etc/init.d/memcached; generated)
   Active: active (running) since Wed 2019-05-22 14:26:55 CEST; 1h 14min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 15169 ExecStart=/etc/init.d/memcached start (code=exited, status=0/SUCCESS)
    Tasks: 35 (limit: 4915)
   CGroup: /system.slice/memcached.service
           └─15176 /usr/bin/memcached -vv -m 512 -p 11211 -u memcache -l 127.0.0.1 -t 32

```

Logstash partial filter (precumputed md5 hash is passed from the grok to the memcached get query) config:

> ```
> memcached {
> hosts => ["localhost:11211"]
> get => {
> "%{md5_hash}" => WHITELISTED_HASH
> }
> }
> 
> ```

From memcache-top:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/e/6e656cc4f37134ff43c57b1d5a6bd54dc98383ab.png)

From logstash monitoring:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/b/0b418099ad3ec1f42550cef43a2f05ebac8eff67.png)

Memcached is running on the same machine, localhost where MTU is maxed out:

> 1: lo: \<LOOPBACK,UP,LOWER\_UP\> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000  
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00  
> inet 127.0.0.1/8 scope host lo  
> valid\_lft forever preferred\_lft forever

Logstash seems to have only 4 connections over the localhost to the local memcached instance and it seems to be the bottleneck.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/f/7f64b4d1d104baeb49f21436e50fbbb0a5481548.png)

Anyone had the same problem/performance limitation etc?  
What is your performance when running the memcached on the local machine?  
I guess I have hit the Logstash processing limit and I need to place Kawka or other message broker in front of Logstash galaxy in order to get higher numbers.

I wonder if the lookups could be improved by switching to the jdbc plugin?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 19, 2019, 1:50pm UTC](https://discuss.elastic.co/t/memcached-performance/182237/2 "2019-06-19T13:50:47Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
