Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very slow start up of Naemon if a system has many downtimes #374

Closed
nook24 opened this issue Nov 24, 2021 · 2 comments
Closed

Very slow start up of Naemon if a system has many downtimes #374

nook24 opened this issue Nov 24, 2021 · 2 comments

Comments

@nook24
Copy link
Member

nook24 commented Nov 24, 2021

Hi,

I found an issue within Naemon which will occur as soon as the system has to handle thousands of downtimes. In this case a restart of Naemon takes more than 15 minutes.

# cat retention.dat | grep hostdowntime | wc -l
21127

# cat retention.dat | grep servicedowntime | wc -l
294420

The issue is caused by the find_comment function

comment *find_comment(unsigned long comment_id, int comment_type)
{
comment *temp_comment = NULL;
for (temp_comment = comment_list; temp_comment != NULL; temp_comment = temp_comment->next) {
if (temp_comment->comment_id == comment_id && (temp_comment->comment_type & comment_type))
return temp_comment;
}
return NULL;
}

My suggestion is to replace this with an hashmap.

@nook24
Copy link
Member Author

nook24 commented Jan 3, 2024

I guess this will be resolved with #440 ?@sni

@sni
Copy link
Contributor

sni commented Jan 4, 2024

that's right.

@sni sni closed this as completed Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants