question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[fix] Jobs starting slowly

See original GitHub issue

Describe the bug

Node.js version: 18.4.0

OS version: Container-Optimized OS with containerd (cos_containerd)

Description: It took ~30 seconds to start a Job

Actual behavior

The thread/worker goes online fast, but actual code execution starts after ~30 seconds.

image

Expected behavior

Code execution to start within a second.

Code to reproduce

/* eslint-disable import/first */
console.log('[start-scheduled-stages] Import modules')

import { startScheduledStages } from '@fastcup/backend-common/tournaments/stages/handle/schedule-stages'
import logger from '@fastcup/backend-common/log'
import { isTournamentAutomationEnabled } from '../utils/index.js'
import { initSentry } from '../utils/sentry.js'

initSentry()

logger.info('[start-scheduled-stages] Start')
if (await isTournamentAutomationEnabled()) {
	await startScheduledStages()
} else {
	logger.warn('Tournament automation is disabled')
}

logger.info('[start-scheduled-stages] done')

Checklist

  • I have searched through GitHub issues for similar issues.
  • I have completely read through the README and documentation.
  • I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
maxpaincommented, Jun 22, 2022

Is there a way to cache imports in worker_threads?

1reaction
shadowgate15commented, Jun 22, 2022

hmm interesting. One solution could be to use longer running jobs. another solution might be to reduce the size of the imports so they load faster.

Read more comments on GitHub >

github_iconTop Results From Across the Web

8 Ways to Fix Slow Boot Times in Windows 10 - MakeUseOf
Thankfully, slow booting is a solvable issue. We'll show you the most common fixes for slow startup problems in Windows 10. This guide...
Read more >
What to Do When Work Is Slow - Harvard Business Review
What to Do When Work Is Slow · Make a plan · Getting More Work Done · Develop yourself · Get ahead ·...
Read more >
How to Fix Slow Startup on Windows 10 | SoftwareKeep
Method 2: Disable processes with high startup impact · Right-click on your taskbar and choose “Task Manager” from the context menu. · Otherwise,...
Read more >
Fix Slow Boot “A start job is running …” in Ubuntu 18.04
Fix Slow Boot “A start job is running …” in Ubuntu 18.04. gnome shell. Ubuntu 18.04 is quite slow to boot up in...
Read more >
Windows 10 slow Startup and Start Menu not working
If lot of programs are running on the start up that it makes the start up slower. I suggest you to check the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found