michaelhodgejr / esx_impound

Adds impound lots to FiveM servers via the ESX Framework
13 stars 12 forks source link

high cpu consumption #3

Closed shyricaus closed 6 years ago

shyricaus commented 6 years ago

when activating the options of seizing vehicle being cop. I would not be adding to the policejob menu

michaelhodgejr commented 6 years ago

A little more information is helpful here:

When activating the options, I assume you mean the menu? So are you take a vehicle to the impound lot or are you impounding it via the /impound command?

And can you define high cpu consumption? How are you determining that is high? Is it via resmon or some other means?

shyricaus commented 6 years ago

Yes I am learning through the command / impound, and when enabled the options of police and mechanics acquiring vehicles, the consumption stays in 6.0 in the resmon colose of the fivem

shyricaus commented 6 years ago

sorry for my engles, because I'm br and I'm using google translate

michaelhodgejr commented 6 years ago

@shyricaus No worries! I'll take a look and see what I can find. I need to make a few other changes to it as well which I'm hoping to do this weekend. Thanks for the additional information!

shyricaus commented 6 years ago

your script is very cool manin. good job

shyricaus commented 6 years ago

I'll be waiting for you

shyricaus commented 6 years ago

another tip update the sql, because when the vehicle is being recovered is not coming back with the board, I made some changes here for me, in case you want to take a look.

CREATE TABLE IF NOT EXISTS impounded_vehicles ( id int(11) NOT NULL AUTO_INCREMENT, vehicle text, owner varchar(250) DEFAULT NULL, plate varchar(12) NOT NULL, impounded_at int(11) DEFAULT NULL, PRIMARY KEY (id), KEY owner (owner) )

michaelhodgejr commented 6 years ago

@shyricaus Yes, I intend to add a plate column to that table this weekend. Additionally, I'm going to be adding support for the esx_migrate plugin which will add a plate column to the owned_vehicles table as well. It will be a configurable option that you can turn on or off

shyricaus commented 6 years ago

I already use the new vehicheshop, it is already upgraded the owned_vehicles with license plate systems

shyricaus commented 6 years ago

I was wondering if I had the ability to link to the police apprehension menu button

michaelhodgejr commented 6 years ago

@shyricaus Can you re-download the module and try it out for me? I refactored the ESX job retrieval and was able to bring the resource usage down by quite a bit locally. Once you let me know that it works I will go ahead and bump the version. I didn't implement the plate column changes yet. I will do that this weekend.

shyricaus commented 6 years ago

thank you. I will be michaelhodgejr

shyricaus commented 6 years ago

when you have enabled the permission function, the consumption is still a bit high.

image

shyricaus commented 6 years ago

and you have to update the server.lua, here's mine for you to take a look at

shyricaus commented 6 years ago

http://www.mediafire.com/file/lek6oq5f6q3643i/esx_impound.rar/file

michaelhodgejr commented 6 years ago

@shyricaus Here is what I'm seeing on my server performance wise

https://i.imgur.com/K6SsdNa.jpg

I just pushed a new version 1.3.0 which has added support for the plate column in the database. Should make database lookups faster, though I can't speak as to how much better performance wise things will be on your end. You can follow the instructions in the readme for upgrading or simply reinstall. Whichever is easier for you.

As for remaining performance issues, I don't deny there may still be some issues, but the fix in 7fda895 resulted in, even on my dev environment, an increase of performance by ~50%, which I'm pretty happy with. I'm not really going to investigate much further into it and try to optimize it.

That being said I'd encourage you, if you desire, to implement a fix and submit pull request. I will review it and get it merged in if it looks good. That's about the best I can offer at this point.