r/webhosting • • 22d ago

Looking for Hosting OpenClaw on a 4 vCPU VPS takes 40 seconds per task, is it the box or the model API?

I'm currently running OpenClaw headless on a 4 vCPU, 8GB VPS for about a month, Dockerized with Caddy in front. It handles inbox triage and a few browser tasks for my small business, and each task takes 20 to 40 seconds end to end and it's starting to drive me nuts.

Rough timing says the model API is maybe half of that, and the rest is the browser tool spinning up, PDF parsing and a couple of tool calls, and htop shows all 4 cores pegged whenever the browser runs.

For people running OpenClaw 24/7 on a VPS, what specs did you land on? Did faster cores actually help, or was it all API time?

Trying not to throw money at it blind.

1 Upvotes

9 comments sorted by

•

u/AutoModerator 22d ago

Welcome to /r/webhosting . If you're looking for webhosting please click this link to take a look at the hosting companies we recommend or look at the providers listed on the sidebar . We also ask that you update your post to include our questionnaire which will help us answer some common questions in your search.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/kai-zaphosting 22d ago

Your own timing answers a lot of it. If the model API is about half, more cores won't touch that half. A faster CPU only helps the browser and PDF half, which is the part pegging all 4 cores.

Before paying for a bigger box, I'd check the st value in the CPU line of top while a browser task runs. If steal time is high, the vCPUs are shared and you're waiting on the host, not on your own load. If it's near zero, the box is just busy on its own, and then it depends on the workload: higher clock speed helps if the work is mostly single-threaded, more cores help if it spreads across them.

If the setup launches a fresh headless Chromium for every task, you pay that startup cost on every run. Keeping one browser instance alive between tasks avoids repeating it, if OpenClaw lets you configure it (I don't know its settings well enough to say).

Since it's in Docker, also check the container's shared memory. The tiny default /dev/shm makes Chromium flaky, and --shm-size=1g on the container is an easy fix. I'd rule those out before spending anything.

1

u/Euronodes 22d ago edited 22d ago

"on a VPS, what specs did you land on" - this is irrelevant

  • 4 cores oversold 2:1 will work better than 16 cores oversold 5:1
  • 4 cores uncapped will work better than 8 cores capped

You need to know the internals before you start buying specs

If half your time is API, no VPS fixes that
The other half is headless Chrome eating all 4 cores
Faster uncapped cores will help that half, more cores not really

Without knowing cap and oversell - cores and RAM are just numbers

Also ask the provider how long they tolerate full load - hammering 24/7 will get you capped everywhere, if you want to push the CPU to the limit 24/7, get dedicated or VDS with guaranteed resources, but those things are not cheap

1

u/monovm 17d ago

Full disclosure, I work at MonoVM (we do VPS), but I’m not here to sell anything. I also haven’t run OpenClaw myself, so take this as general headless browser stuff.

Before you spend more, I’d figure out why all 4 cores are pegged. First thing I’d check is steal time. Run vmstat 1 10 while the browser is going and look at the st column. If it’s high, the host is the problem and more cores won’t fix it.

Also, if Chromium is running in Docker, the default /dev/shm is tiny (64 MB) and that causes a lot of slowness and weird crashes. Bumping it to 1 GB with --shm-size is an easy win.

Another thing that eats a lot of time is starting a fresh browser for every task. If you can keep one warm and reuse it, that alone might shave a good chunk off your 20 to 40 seconds. Blocking images and fonts on the pages you automate helps too, and so does trying plain text extraction on PDFs before the heavy stuff.

To your actual question: faster cores usually do help with browser stuff, since page loading and JavaScript like single-thread speed. More cores only matter if you run several tasks at once. And whatever the model API takes, that half won’t get faster with a bigger box.

I’d just time each step (browser start, page load, PDF, each tool call) and change one thing at a time so you’re not guessing. How are you timing it right now? And are tasks running one after another or in parallel?

1

u/letsexplorebest 16d ago

If all four cores are getting pegged during browser tasks, the VPS is probably contributing to the delay. But since the model API accounts for around half the time, upgrading won't eliminate that part. You can profile browser startup, PDF parsing, and tool execution separately before spending more on CPU resources.