[
https://issues.apache.org/jira/browse/DISPATCH-1373?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ganesh Murthy updated DISPATCH-1373:
------------------------------------
Labels: performance (was: )
> the log system mutex is held far too long
> -----------------------------------------
>
> Key: DISPATCH-1373
> URL: https://issues.apache.org/jira/browse/DISPATCH-1373
> Project: Qpid Dispatch
> Issue Type: Bug
> Components: Router Node
> Affects Versions: 1.8.0, 1.9.0
> Reporter: Ken Giusti
> Priority: Major
> Labels: performance
>
> The log code holds the log mutex(s) too long. Depending on the log level
> (trace+ is worst) the lock has been observed being held for > 30 milliseconds.
> The log lock is a singleton that is acquired by all calls to qd_log (active
> log level only) - which means it is a global lock.
> It appears as if the lock is held while doing I/O and alloc/dealloc'ing
> memory - which may be expensive (in qd_vlog_impl() in log.c):
>
> {{ // Bounded buffer of log entries, keep most recent.}}
> {{ *sys_mutex_lock(log_lock);*}}
> {{ qd_log_entry_t *entry = new_qd_log_entry_t();}}
> {{ DEQ_ITEM_INIT(entry);}}
> {{ entry->module = source->module;}}
> {{ entry->level = level;}}
> {{ entry->file = file ? strdup(file) : 0;}}
> {{ entry->line = line;}}
> {{ gettimeofday(&entry->time, NULL);}}
> {{ vsnprintf(entry->text, TEXT_MAX, fmt, ap);}}
> {{ write_log(source, entry);}}
> {{ DEQ_INSERT_TAIL(entries, entry);}}
> {{ if (DEQ_SIZE(entries) > LIST_MAX)}}
> {{ qd_log_entry_free_lh(DEQ_HEAD(entries));}}
> {{ *sys_mutex_unlock(log_lock);*}}{{}}
>
--
This message was sent by Atlassian Jira
(v8.3.2#803003)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]