Problem/Motivation

Setting up a new server I see the following error occasionally:
Notice: MemcachePool::set(): Server 127.0.0.1 (tcp 11211, udp 0) failed with: SERVER_ERROR object too large for cache (3) in Drupal\memcache\Driver\MemcacheDriver->set() (line 17 of modules/contrib/memcache/src/Driver/MemcacheDriver.php)

Software versions:
memcached: 1.6.9+dfsg-1 amd64
PHP: 8.0.21
php8.0-memcache: 8.0+4.0.5.2+3.0.9~20170802.e702b5f9+-7+0~20220117.28+debian11~1.gbp8ceec4 amd64

Proposed resolution

Work out how to either configure memcached to avoid the problem, or change Memcache to fix the problem.

Remaining tasks

Work out the best approach.
Do eet.

User interface changes

n/a

API changes

TBD

Data model changes

TBD

CommentFileSizeAuthor
#8 memcache-n3303674-8.patch1.22 KBdamienmckenna

Comments

DamienMcKenna created an issue. See original summary.

damienmckenna’s picture

Version: 8.x-2.4 » 8.x-2.x-dev

I modified /etc/memcached.conf to add this:

# Override the default size of each slab page. The default size is 1mb. Default value for this  parameter
# is  1m,  minimum  is  1k,  max  is 1G (1024 * 1024 * 1024).  Adjusting this value changes the item size
# limit.
# --max-item-size=<size>
-I 5M

It might be worth documenting this problem and that the suggested fix is to change the -I value.

damienmckenna’s picture

Note: the -I value must be specified with a capital letter, e.g. "5M".

elijah lynn’s picture

Thanks for this, I found your issue by searching for "Object too large"! I had this issue on an AWS Elasticache Memcache and fixed it by creating a custom param group and changed the value `max_item_size` to `4194304` (which is 4M) for our needs which resolved the error.

damienmckenna’s picture

Even with the config set to 5M the error still happens :-\

In this latest case the site was reindexing the content on a Solr server with Search API.

japerry’s picture

Category: Bug report » Support request
Status: Active » Closed (cannot reproduce)

Closing as this isn't really an issue in the module per se.

damienmckenna’s picture

Component: Code » Documentation
Assigned: Unassigned » damienmckenna
Category: Support request » Task
Status: Closed (cannot reproduce) » Active

Let's add this to the docs as a Known Issues item, or something similar. Assigning it to myself in the hopes I might throw something together for it.

damienmckenna’s picture

Assigned: damienmckenna » Unassigned
Status: Active » Needs review
StatusFileSize
new1.22 KB

How about something like this?

  • japerry committed ae689e0c on 8.x-2.x
    Issue #3303674 by DamienMcKenna: "object too large for cache" error
    
japerry’s picture

Status: Needs review » Fixed

Fair enough, pushed the readme fix!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.