forked from mirrors/kore
- Better spread load between all worker processes.
- Introduce own memory management system on top of malloc to keep track of all our allocations and free's. Later we should introduce a pooling mechanism for fixed size allocations (http_request comes to mind). - Introduce ssl_cipher in configuration. Memory usage is kind of high right now, but it seems its OpenSSL doing it rather then Kore.
This commit is contained in:
parent
7828bd0cfc
commit
4b2420097b
|
@ -212,7 +212,6 @@ void *kore_calloc(size_t, size_t);
|
|||
void *kore_realloc(void *, size_t);
|
||||
void kore_mem_free(void *);
|
||||
void kore_mem_init(void);
|
||||
void kore_mem_dump(void);
|
||||
|
||||
time_t kore_date_to_time(char *);
|
||||
char *kore_time_to_date(time_t);
|
||||
|
|
18
src/mem.c
18
src/mem.c
|
@ -124,29 +124,11 @@ kore_mem_free(void *ptr)
|
|||
if (mem->magic != KORE_MEM_MAGIC)
|
||||
fatal("kore_mem_free(): magic boundary not found");
|
||||
|
||||
//t = kore_time_ms();
|
||||
//printf("mem#%d released, %ld ms old\n", mem->id, t - mem->t);
|
||||
|
||||
meminuse -= mem->clen;
|
||||
TAILQ_REMOVE(&memused, mem, list);
|
||||
free(mem);
|
||||
}
|
||||
|
||||
void
|
||||
kore_mem_dump(void)
|
||||
{
|
||||
printf("wrk#%d: %d bytes in use\n", worker->id, meminuse);
|
||||
|
||||
#if 0
|
||||
now = kore_time_ms();
|
||||
TAILQ_FOREACH(mem, &memused, list) {
|
||||
length = now - mem->t;
|
||||
printf("wrk#%d: mem#%d %d bytes (%ld ms)\n",
|
||||
worker->id, mem->id, mem->clen, length);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
char *
|
||||
kore_strdup(const char *str)
|
||||
{
|
||||
|
|
|
@ -242,9 +242,6 @@ kore_worker_entry(struct kore_worker *kw)
|
|||
kore_worker_acceptlock_release();
|
||||
}
|
||||
|
||||
printf("%d: %d conn / %d mem\n", worker->id,
|
||||
worker_active_connections, meminuse);
|
||||
|
||||
http_process();
|
||||
|
||||
for (c = TAILQ_FIRST(&disconnected); c != NULL; c = cnext) {
|
||||
|
|
Loading…
Reference in New Issue