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

[Bug] Thehive4 is slow for list alerts #1584

Closed
nicodeff opened this issue Oct 19, 2020 · 11 comments
Closed

[Bug] Thehive4 is slow for list alerts #1584

nicodeff opened this issue Oct 19, 2020 · 11 comments
Assignees
Labels

Comments

@nicodeff
Copy link

Request Type

Bug

Work Environment

Question Answer
OS version (server) CentOS
OS version (client) 7.4.1708
TheHive version / git hash 4.0.0-1
Package Type RPM
Browser type & version Chrome

Problem Description

Hello,

I am currently making a poc of thehive4 to replace our current version of thehive 3.4.2-1
I migrated all cases and alerts from thehive 3.4 to thehive4 (1242 cases and 12480 alerts).

When I want to go to Thehive alerts page. This page takes long seconds to display alerts.

image

I carried out some tests via the API and it seems that there is a high latency by applying a "desc" sort on the "date" field (basic behavior carried out by the webUI)

Without sort : time execution less than 1 sec

date; curl https://(thehiveURL)/api/v1/query -s -u (login):(pwd) -H "Content-type: application/json" -d '{"query": [{"_name": "listAlert"},{"_name": "page", "from": 0, "to": 15}]}' --insecure >/dev/null; date
Mon Oct 19 15:59:11 2020
Mon Oct 19 15:59:11 2020

With sort : time execution 7 sec

date; curl https://(thehiveURL)/api/v1/query -s -u (user):(password) -H "Content-type: application/json" -d '{"query": [{"_name": "listAlert"},{"_name": "sort", "_fields": [{"date": "desc"}]},{"_name": "page", "from": 0, "to": 15}]}' --insecure >/dev/null; date
Mon Oct 19 16:03:28 2020
Mon Oct 19 16:03:35 2020

Is this a known issue ?

this latency is for us a blocking point to finalize the migration to thehive4.

Thanks,

Regards,

@nicodeff nicodeff added TheHive4 TheHive4 related issues bug labels Oct 19, 2020
@miyoyo
Copy link

miyoyo commented Oct 20, 2020

To get accurate execution delays, you can use the time tool as such:

time curl https://(thehiveURL)/api/v1/query -s -u (login):(pwd) -H "Content-type: application/json" -d '{"query": [{"_name": "listAlert"},{"_name": "page", "from": 0, "to": 15}]}' --insecure

@nicodeff
Copy link
Author

Hello,
Okey :)

Without sort :

time curl https://(thehiveURL)/api/v1/query -s -u (login):(pwd) -H "Content-type: application/json" -d '{"query": [{"_name": "listAlert"},{"_name": "page", "from": 0, "to": 15}]}' --insecure

real    0m0.458s
user    0m0.050s
sys     0m0.122s

With sort :

time curl https://(thehiveURL)/api/v1/query -s -u (login):(pwd) -H "Content-type: application/json" -d '{"query": [{"_name": "listAlert"},{"_name": "sort", "_fields": [{"date": "desc"}]},{"_name": "page", "from": 0, "to": 15}]} --insecure

real    0m7.143s
user    0m0.042s
sys     0m0.123s

@nadouani
Copy link
Contributor

Hello @nicodeff Thanks for the entry. We are working to improve and fix this type of issues. Stay tuned.

@nicodeff
Copy link
Author

nicodeff commented Nov 5, 2020

Hello @nadouani,

Do you have informations about the fix.
Have you been able to replay this bug in your environment ?

Thanks,

@nadouani
Copy link
Contributor

Hello @nicodeff this performance issue will be globally fixed in TheHive 4.1 (target before end of the year). Work is still in progress

@nicodeff
Copy link
Author

Thanks @nadouani fot this great news.
I waiting this update impatiently.

Regards,

@crackytsi
Copy link

I really hope that this topic gets a high priority, as its a hard effect when migrating from TheHive3 to TheHive4 ;)

@nicodeff
Copy link
Author

Hello @nadouani , this problem will it be fixed in TheHive 4.1 ?
In the Milestones, I don't see any cases for fix this problem.

Thanks,

Regards,

@nicodeff
Copy link
Author

Hello,

We had installed TheHive Xmas edition 4.0.3 and we haven't unfortunately observe an amelioration .

Time for 12500 alerts :

time curl http://(URL)/api/v1/query -s -u (login):(password) -H "Content-type: application/json" -d '{"query": [{"_name": "listAlert"},{"_name": "sort", "_fields": [{"date": "desc"}]},{"_name": "page", "from": 0, "to": 15}]}'

real    0m6.940s
user    0m0.003s
sys     0m0.004s

For listing cases we have not the same problem, but we have 'only' 1300 cases.

time curl http://(URL)/api/v1/query -s -u (login):(password) -H "Content-type: application/json" -d '{"query": [{"_name": "listCase"},{"_name": "sort", "_fields": [{"flag": "desc"}]},{"_name": "page", "from": 0, "to": 15,"extraData":["observableStats","taskStats","isOwner","shareCount","permissions","actionRequired"]}]}'

real    0m6.940s
user    0m0.003s
sys     0m0.004s

Regards,

@rriclet
Copy link
Contributor

rriclet commented Mar 19, 2021

This issue has been fixed with #1731, included in release 4.1.0.
Feel free to re-open this issue if you still notice slow performance.

@rriclet rriclet closed this as completed Mar 19, 2021
@MonkeySec
Copy link

MonkeySec commented Sep 15, 2021

@rriclet @nadouani

This still appears to be an issue. I have recently migrated to The Hive version 4.1.9-1.

We have a total of 247 alerts.

Replicating the same testing queries I see load times of 4 seconds by default, and 17 seconds with sorting. Both of which seem too slow for such a little number of alerts:

Without Sorting - 4 seconds, which is still slower than expected

time curl https://HIVEURL/api/v1/query?name=alerts -s -u USERNAME:PASSWORD -H "Content-type: application/json" -d '{"query": [{"_name":
"listAlert"},{"_name": "page", "from": 0, "to": 15}]}' --insecure

real 0m4.011s
user 0m0.031s
sys 0m0.063s

With Sorting - Over 17 seconds!

time curl https://HIVEURL/api/v1/query?name=alerts -s -u USERNAME:PASSWORD -H "Content-type: application/json" -d '{"query": [{"_name": "listAlert"},{"_name": "sort", "_fields": [{"date": "desc"}]},{"_name": "page", "from": 0, "to": 15}]}' --insecure

real 0m17.926s
user 0m0.047s
sys 0m0.063s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants