# Slow wp-admin; 500 error admin-ajax.php; M1 Macbook

**URL:** https://community.kinsta.com/t/slow-wp-admin-500-error-admin-ajax-php-m1-macbook/957
**Category:** Application Support
**Created:** [August 28, 2021, 7:58pm UTC](https://community.kinsta.com/t/slow-wp-admin-500-error-admin-ajax-php-m1-macbook/957 "2021-08-28T19:58:56Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![Chronic\_Pete](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/chronic_pete/32/640_2.png) [@Chronic\_Pete](https://community.kinsta.com/u/Chronic_Pete)
#### Post date: [August 28, 2021, 7:58pm UTC](https://community.kinsta.com/t/slow-wp-admin-500-error-admin-ajax-php-m1-macbook/957/1 "2021-08-28T19:58:56Z")

</div>

I’m using DevKinsta on a new macbook pro (M1). The front-end of one of the websites loads fine, but the wp-admin back-end is painfully slow, sometimes taking 20-30 seconds to load a page.

Additionally (and more importantly), with one specific website, I get a 500 error on admin-ajax.php that prevents using the Elementor plugin entirely. This is the error I’m getting in the browser console:  
Failed to load resource: the server responded with a status of 500 () /wp-admin/admin-ajax.php:1

When I check the nginx error log, I see the following error:

2021/08/27 22:21:31 [error] 102#102: \*195 FastCGI sent in stderr: “PHP message: PHP Fatal error: Out of memory (allocated 62164992) (tried to allocate 7751200 bytes) in /www/kinsta/public/corneacare/wp-content/plugins/elementor/core/common/modules/ajax/module.php on line 265” while reading response header from upstream, client: 172.18.0.1, server: corneacare.local, request: “POST /wp-admin/admin-ajax.php HTTP/2.0”, upstream: “fastcgi://172.18.0.3:9002”, host: “corneacare.local”, referrer: “[https://corneacare.local/wp-admin/post.php?post=975&action=elementor](https://corneacare.local/wp-admin/post.php?post=975&action=elementor)”

I’ve increased the max\_execution\_time in php to 1200, increased max\_input\_time to unlimited (-1), and increased memory\_limit to a whopping 2048, and I still get the same error.

I’ve also tried editing and adding some rules to the nginx config:  
fastcgi\_buffers 16 32k;  
fastcgi\_buffer\_size 64k;  
fastcgi\_read\_timeout 600;

After restarting php-fpm and nginx from the docker dashboard, none of these changes seem to have any effect.

I’ve also tried disabling every plugin aside from Elementor, and the problem persists.

This is a site that’s cloned from Kinsta, and it works very fast, with no errors, on the live Kinsta host. It also works fine in my homespun local dev environment on my old macbook. So this issue seems to be isolated to the DevKinsta environment.

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [August 30, 2021, 2:19pm UTC](https://community.kinsta.com/t/slow-wp-admin-500-error-admin-ajax-php-m1-macbook/957/2 "2021-08-30T14:19:31Z")

</div>

Welcome to DevKinsta @Chronic_Pete ! I’m happy to help.

Could you try creating a file called `phpinfo.php` inside your sites directory structure and put in the following lines on that file?

```auto
<?php
phpinfo();
?>

```

Then load the file on your browser and tell me if the values you’ve updated are being applied.

---

<div class="post-metadata">

### Author: ![Chronic\_Pete](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/chronic_pete/32/640_2.png) [@Chronic\_Pete](https://community.kinsta.com/u/Chronic_Pete)
#### Post date: [August 30, 2021, 3:10pm UTC](https://community.kinsta.com/t/slow-wp-admin-500-error-admin-ajax-php-m1-macbook/957/3 "2021-08-30T15:10:54Z")

</div>

Hi @michael!

Thanks for the [should-be obvious] troubleshooting suggestion. The values aren’t being applied.

By the way, in order to change those values, I opened the CLI for devkinsta\_fpm, using the CLI button in the devkinsta dashboard. I installed vim on that container, edited the file at /etc/php/7.4/fpm/php.ini (this site is using 7.4), closed and saved the file, and restarted the container from the docker dashboard using the restart button.

---

<div class="post-metadata">

### Author: ![Chronic\_Pete](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/chronic_pete/32/640_2.png) [@Chronic\_Pete](https://community.kinsta.com/u/Chronic_Pete)
#### Post date: [August 31, 2021, 12:45am UTC](https://community.kinsta.com/t/slow-wp-admin-500-error-admin-ajax-php-m1-macbook/957/4 "2021-08-31T00:45:38Z")

</div>

@michael - I also tried switching that website to PHP 8.0 via the devkinsta interface, editing the php.ini file at /etc/php/8.0/fpm, and restarting php via the docker restart devkinsta\_fpm command. When I reloaded the phpinfo page, it still shows PHP Version 7.4.18 as the php version, and none of the settings are updated.

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [August 31, 2021, 2:29pm UTC](https://community.kinsta.com/t/slow-wp-admin-500-error-admin-ajax-php-m1-macbook/957/5 "2021-08-31T14:29:33Z")

</div>

Thanks for testing that. Seems like there’s a larger issue here as changing PHP versions should be working by default without any changes.

Try exiting out of DevKinsta, delete the devkinsta\_fpm container, and reload DevKinsta so it can create it again. Then test changing versions again to see if that helps. Deleting the devkinsta\_fpm won’t erase any of the data.

---

<div class="post-metadata">

### Author: ![Chronic\_Pete](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/chronic_pete/32/640_2.png) [@Chronic\_Pete](https://community.kinsta.com/u/Chronic_Pete)
#### Post date: [August 31, 2021, 5:08pm UTC](https://community.kinsta.com/t/slow-wp-admin-500-error-admin-ajax-php-m1-macbook/957/6 "2021-08-31T17:08:15Z")

</div>

Thanks @michael. I just did what you suggested. It did switch the version of php up to 8.0.5. I then tried changing those values again, and restarting the php container. The changes still didn’t take. Then I updated and upgraded all of the server packages, tried altering the values in php.ini again, and it still won’t work. I double-checked to make sure there’s only one instance of devkinsta\_fpm in docker desktop, and I’ve confirmed that.

One interesting thing to note: I’ve gotten that out of memory error even when the allocated memory was far higher than the memory that it was trying to allocate:  
2021/08/31 16:59:56 [error] 76#76: \*73 FastCGI sent in stderr: "PHP message: PHP Fatal error: Out of memory (allocated 62164992) (tried to allocate 32768 bytes)

---

<div class="post-metadata">

### Author: ![philippstracker](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/philippstracker/32/638_2.png) [@philippstracker](https://community.kinsta.com/u/philippstracker)
#### Post date: [August 31, 2021, 8:45pm UTC](https://community.kinsta.com/t/slow-wp-admin-500-error-admin-ajax-php-m1-macbook/957/7 "2021-08-31T20:45:29Z")

</div>

I’ve had very similar behavior on a DevKinsta website.

I deleted the two files `wp-content/advanced-cache.php` and `wp-content/object-cache.php` + the wp-rocket plugin on the local dev site. After that, my local site did not throw “out of memory” errors anymore.

Maybe this helps you as well.

About the php.ini changes:

Try this command in the docker CLI:

```auto
grep memory_limit /etc/php/7.4/fpm/**/*.ini

```

You will see that there is another config file (tuning.ini) that overwrites the default php.ini value for “memory\_limit”

Solution: Create a new config file with a prefix like “zz” - the ini files are loaded in alphabetical order and files that are loaded later will overwrite settings of earlier files:

```auto
vim /etc/php/7.4/fpm/conf.d/zz-custom.ini

# set your custom memory_limit / other PHP settings here and restart the FPM container

```

---

<div class="post-metadata">

### Author: ![philippstracker](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/philippstracker/32/638_2.png) [@philippstracker](https://community.kinsta.com/u/philippstracker)
#### Post date: [August 31, 2021, 9:08pm UTC](https://community.kinsta.com/t/slow-wp-admin-500-error-admin-ajax-php-m1-macbook/957/8 "2021-08-31T21:08:55Z")

</div>

Btw, I just came across this report here: [Memory Leak on M1 Macs · Issue #5204 · docker/for-mac · GitHub](https://github.com/docker/for-mac/issues/5204). Seems like Docker for Mac + PHP + M1 has some issues.

---

<div class="post-metadata">

### Author: ![Chronic\_Pete](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/chronic_pete/32/640_2.png) [@Chronic\_Pete](https://community.kinsta.com/u/Chronic_Pete)
#### Post date: [September 1, 2021, 9:17pm UTC](https://community.kinsta.com/t/slow-wp-admin-500-error-admin-ajax-php-m1-macbook/957/9 "2021-09-01T21:17:39Z")

</div>

Thanks @philippstracker. I don’t have that plugin installed, but overriding the php.ini settings in the conf.d files was a great find! I did manage to get those changes to take effect, but unfortunately, I’m getting the out of memory error no matter how much memory I give php-fpm. I’ve increased it to 2G and the error still occurs.

I also installed wp cli on the devkinsta\_fpm container, optimized the db and deleted expired transients. That didn’t fix the issue either.

This issue is isolated to this one instance within devkinsta, too. I have another dummy site set up in devkinsta with Elementor, which wasn’t imported from Kinsta hosting. The error isn’t occurring there. I’ll continue to troubleshoot and if I figure out what’s going on I’ll post it here in case anyone else has the same problem.

I tried to recreate this site in devkinsta manually instead of pulling it from Kinsta, but when I imported the database that I’d exported from kinsta’s phpmyadmin, it crashed the nginx server in devkinsta.

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [September 1, 2021, 9:53pm UTC](https://community.kinsta.com/t/slow-wp-admin-500-error-admin-ajax-php-m1-macbook/957/10 "2021-09-01T21:53:27Z")

</div>

> [@Chronic\_Pete](#):
>
> This issue is isolated to this one instance within devkinsta, too. I have another dummy site set up in devkinsta with Elementor, which wasn’t imported from Kinsta hosting

That’s odd 🤔 . I’ll keep researching this one and will report back soon!

---

<div class="post-metadata">

### Author: ![Chronic\_Pete](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/chronic_pete/32/640_2.png) [@Chronic\_Pete](https://community.kinsta.com/u/Chronic_Pete)
#### Post date: [September 1, 2021, 11:06pm UTC](https://community.kinsta.com/t/slow-wp-admin-500-error-admin-ajax-php-m1-macbook/957/11 "2021-09-01T23:06:28Z")

</div>

@michael very strange indeed. After all of the workarounds I’ve tried, I think this might have something to do with the memory link in Docker Desktop on M1 macs that @philippstracker mentioned above. Docker says they’ve resolved the issue but it tracks with some of the comments in that thread in github.

This user’s workaround swapped out some x64 libs with ARM libs. If I want to try this, where would I find the appropriate Dockerfile on my machine?

> <https://github.com/docker/for-mac/issues/5204#issuecomment-776823868>
>
> \- \[x\] I have tried with the latest version of my channel (Stable or Edge)
> - \[…x\] I have uploaded Diagnostics
> 
> \### Expected behavior
> Memory should be correctly freed
> \### Actual behavior
> Memory is not correctly freed
> \### Information
> When running dockers on M1, memory is not properly freed, even when quitting the corresponding docker container. My actual scripts keep encountering out of memory errors which they don't do on my intel Mac, so this doesn't seem to be a tracking issue.
> 
> - macOS Version: Big Sur 11.1
> \`\`\`
> Docker for Mac: Docker version 20.10.1, build 831ebeae96
> 
> \`\`\`
> 
> \### Steps to reproduce the behavior
> use the official python 3.8 container under x86\_64 emulation or on arm chip directly
> run the following minimal example:
> \`\`\`python
> pip install numpy
> python
> import numpy as np
> l = \[\]
> for \_ in range(1000):
> l+=\[np.random.rand(512,512)\]
> del l
> \`\`\`
> In activity monitor memory allocated by docker will never go away until quitting docker. htop within the container may or may not correctly reflect the memory usage, it is not consistent.
> 
> a more complex example for my use case using ray (x86\_64 emulation) continually builds up memory when scheduling arbitrary tasks even if objects are no longer referenced and will encounter an out of memory error.

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [September 2, 2021, 2:31pm UTC](https://community.kinsta.com/t/slow-wp-admin-500-error-admin-ajax-php-m1-macbook/957/12 "2021-09-02T14:31:39Z")

</div>

@Chronic_Pete What version of Docker do you have? Docker 4.0.0 for MacOS was released a couple days ago. If you don’t have that version, could you try updating and let me know if that works for you?

---

<div class="post-metadata">

### Author: ![Chronic\_Pete](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/chronic_pete/32/640_2.png) [@Chronic\_Pete](https://community.kinsta.com/u/Chronic_Pete)
#### Post date: [September 2, 2021, 3:06pm UTC](https://community.kinsta.com/t/slow-wp-admin-500-error-admin-ajax-php-m1-macbook/957/13 "2021-09-02T15:06:27Z")

</div>

@michael I have 4.0.0 (67817)

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [September 3, 2021, 2:27pm UTC](https://community.kinsta.com/t/slow-wp-admin-500-error-admin-ajax-php-m1-macbook/957/14 "2021-09-03T14:27:35Z")

</div>

Hey @Chronic_Pete . We’ve been testing on Apple M1 machines and haven’t been able to reproduce the issues here (so far). It’s a bit odd that it’s only occurring on one site. Have you already tried to re-import the site?

---

<div class="post-metadata">

### Author: ![Chronic\_Pete](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/chronic_pete/32/640_2.png) [@Chronic\_Pete](https://community.kinsta.com/u/Chronic_Pete)
#### Post date: [September 8, 2021, 2:22pm UTC](https://community.kinsta.com/t/slow-wp-admin-500-error-admin-ajax-php-m1-macbook/957/15 "2021-09-08T14:22:39Z")

</div>

Hi @michael - Yeah, I’ve had to delete and re-import the site several times per week - there’s another person working on the content side, so I often need to update my local environment. When I’ve tried to just import the database, it crashes the nginx server in Docker. So the only way I can do this with DevKinsta is to back up the theme (to be safe), delete the local site from within DevKinsta, and re-import it using the DevKinsta import tool. It would be much easier if I could just update the local db.

---

<div class="post-metadata">

### Author: ![philippstracker](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/philippstracker/32/638_2.png) [@philippstracker](https://community.kinsta.com/u/philippstracker)
#### Post date: [September 9, 2021, 3:41pm UTC](https://community.kinsta.com/t/slow-wp-admin-500-error-admin-ajax-php-m1-macbook/957/16 "2021-09-09T15:41:50Z")

</div>

Another idea for a workaround:  
I’m using WP Migrate DB Pro to keep local/stage/live websites in sync. Maybe this is an option for you - it is very reliable and fast.

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [November 10, 2021, 2:52pm UTC](https://community.kinsta.com/t/slow-wp-admin-500-error-admin-ajax-php-m1-macbook/957/17 "2021-11-10T14:52:29Z")

</div>

Hey @Chronic_Pete. Could you try [DevKinsta 2.3.0](https://devkinsta.com) and let me know if this issue continues?
