mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 14:51:11 +01:00
Merge branch 'bug4518' into maint-0.2.2
This commit is contained in:
commit
f4e053d6df
2 changed files with 16 additions and 2 deletions
4
changes/bug4518
Normal file
4
changes/bug4518
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
o Minor bugfixes (performance):
|
||||||
|
- Avoid frequent calls to the fairly expensive cull_wedged_cpuworkers
|
||||||
|
function. This was eating up hideously large amounts of time on some
|
||||||
|
busy servers. Fixes bug 4518.
|
|
@ -446,9 +446,19 @@ assign_onionskin_to_cpuworker(connection_t *cpuworker,
|
||||||
{
|
{
|
||||||
char qbuf[1];
|
char qbuf[1];
|
||||||
char tag[TAG_LEN];
|
char tag[TAG_LEN];
|
||||||
|
time_t now = approx_time();
|
||||||
|
static time_t last_culled_cpuworkers = 0;
|
||||||
|
|
||||||
|
/* Checking for wedged cpuworkers requires a linear search over all
|
||||||
|
* connections, so let's do it only once a minute.
|
||||||
|
*/
|
||||||
|
#define CULL_CPUWORKERS_INTERVAL 60
|
||||||
|
|
||||||
|
if (last_culled_cpuworkers + CULL_CPUWORKERS_INTERVAL <= now) {
|
||||||
cull_wedged_cpuworkers();
|
cull_wedged_cpuworkers();
|
||||||
spawn_enough_cpuworkers();
|
spawn_enough_cpuworkers();
|
||||||
|
last_culled_cpuworkers = now;
|
||||||
|
}
|
||||||
|
|
||||||
if (1) {
|
if (1) {
|
||||||
if (num_cpuworkers_busy == num_cpuworkers) {
|
if (num_cpuworkers_busy == num_cpuworkers) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue