Commit Graph

422 Commits

Author SHA1 Message Date
Joris Vink ef49a0d4e1 Don't use pidfile if we're in foreground mode 2014-07-31 14:02:33 +02:00
Joris Vink a664e2a655 Make some configuration options fallback to defaults.
* If no runas_user is given, use current user.
* If no chroot path is given, don't complain if -n
* If no workers is set, use the default 1.
2014-07-31 13:59:42 +02:00
Joris Vink 2d9940e197 Add foreground 2014-07-31 13:43:37 +02:00
Joris Vink 9b76afc5fb Whoops, remove KORE_BENCHMARK that sneaked in 2014-07-31 13:35:39 +02:00
Joris Vink 8812d6989a Allow Kore to be started in foreground mode (-f)
Sending SIGINT or Ctrl-c will reap all workers and
exit again. Useful for development.
2014-07-31 13:27:04 +02:00
Joris Vink 9c4e7c888f kill newline 2014-07-31 12:27:41 +02:00
Joris Vink 7fd936bb94 Add coverity badge, cause why not 2014-07-31 10:41:30 +02:00
Joris Vink 22e1e1c425 Add worker_rlimit_nofiles as a configurable option. 2014-07-31 09:14:03 +02:00
Joris Vink 26d4d5d63b Rework the accept lock.
Kore no longer passes the accept lock to the "next in line"
worker but instead all workers will attempt to grab the lock
if they can.

Also remember if we had the lock previous iteration of the
event loop and don't constantly disable/enable the accepting sockets.

Makes Kore scale even better across multiple cpu's.
2014-07-30 15:20:09 +02:00
Joris Vink 83f890e89e No longer preallocate worker_max_connections for the http pools.
Instead use 10% of worker_max_connections up to a maximum of 1000.
2014-07-30 13:20:27 +02:00
Joris Vink e1dff2e051 We've become a framework really 2014-07-30 09:43:29 +02:00
Joris Vink 9b13f57711 Add 1.2 release date + spelling 2014-07-30 09:14:36 +02:00
Joris Vink efe732cc1f Update readme 2014-07-30 09:12:59 +02:00
Joris Vink cb3322cd9f Make accesslogs optional 2014-07-30 09:11:21 +02:00
Joris Vink 3f853a79ce Add example configuration under conf/ 2014-07-30 09:02:34 +02:00
Joris Vink a895250e97 Make sure l and c are initialized 2014-07-30 09:00:19 +02:00
Joris Vink fe0149ad24 Have workers always pass the accept lock after handling their events.
Provides a nice performance boost when scaling across multiple cpu's.
2014-07-29 13:14:34 +02:00
Joris Vink 478c008c99 Missing parts from last commit 2014-07-28 23:35:12 +02:00
Joris Vink 8313a31eba If we do not own the accept lock, reduce timeout for platform wait.
This way multiple workers won't stall when passing the accept lock
around for at maximum 100 ms (time spent in epoll/kqueue waits).
2014-07-28 23:27:58 +02:00
Joris Vink ea07ddef34 Properly send out early HTTP errors via the appropriate SPDY stream 2014-07-27 21:59:25 +02:00
Joris Vink c1bc0ce13f Check return value for pthread_mutex_init() 2014-07-27 21:47:18 +02:00
Joris Vink 257486d74a Remove req from http_requests before other things 2014-07-27 21:01:14 +02:00
Joris Vink 8c22f0f004 In http_request_free() remove the req from the owner connection. 2014-07-27 21:00:17 +02:00
Joris Vink c9f39c9c9d Set module->ocb to NULL 2014-07-22 10:47:12 +02:00
Joris Vink fbfabf6f04 Add missing stdint.h header 2014-07-22 09:53:44 +02:00
Joris Vink 341a111a2f Rework kore_strtonum64() so we can catch overflows for u_int64_t.
Seems that strtoull() if a negative string is supplied rather just
wraps the value, which I don't want here.
2014-07-21 01:51:51 +02:00
Joris Vink 25cf8dc659 Wrong comparison in kore_strtonum64(), fix. 2014-07-21 01:19:39 +02:00
Joris Vink d4cec3427e Properly convert 64bit parameters.
Introduces kore_strtonum64() for just this purpose as to
not taint kore_strtonum() too much.
2014-07-21 01:16:03 +02:00
Joris Vink ac345410dc Add support for fetching parameters as 64bit integers. 2014-07-20 00:43:32 +02:00
Joris Vink 1d8fc99920 Add glue to build task_curl example under osx 2014-07-18 16:09:15 +02:00
Joris Vink e0f30e1ae7 Fix broken include paths and lib paths 2014-07-18 16:05:19 +02:00
Joris Vink a5806d91f8 Pull in pg_config.h correctly, fixes compilation for pgsql under OpenBSD 2014-07-18 15:59:07 +02:00
Joris Vink c3ea0e9e66 Include pthread.h in tasks.h, fixes compilation under OpenBSD 2014-07-18 15:51:13 +02:00
Joris Vink 86434a57c1 Bump to 1.2-release in preparation of the actual release 2014-07-17 10:22:45 +02:00
Joris Vink 5d4f956f69 Rewrite some comments as task behaviour has changed 2014-07-08 09:12:05 +02:00
Joris Vink 19d146a09e Introduce http_request_sleep() and http_request_wakeup().
These 2 functions can be used to move an HTTP request
from/to the active http_requests list. Effectively
putting them to "sleep" or "waking them up".

Sprinkle this through the pgsql and task code.

If used correctly greatly reduces overhead for
managing sleeping tasks.
2014-07-04 16:51:19 +02:00
Joris Vink 7b6c03ca5b Task improvements.
Synchronize access to state/result properly so one
can access these from inside the task as well.

Introduce KORE_TASK_STATE_ABORT which will be set
when a task needs to be abort. You can use this
to create tasks that run in a loop until aborted.
2014-07-04 11:28:17 +02:00
Joris Vink baac693f2f Change type for data to void * 2014-07-04 11:25:05 +02:00
Joris Vink 423d57b08d Add -v to dump out version and compiled in features 2014-07-04 09:25:18 +02:00
Joris Vink 35479f7ee7 Fix module configuration 2014-07-04 09:14:34 +02:00
Joris Vink 1ad9f039ab Add pgsql_conn_max configuration parameter.
Allows you to tune how many pgsql connections kore
will make at one time.
2014-07-04 09:14:05 +02:00
Joris Vink 8b20dec081 Add missing pg_config.h header 2014-07-04 09:03:19 +02:00
Joris Vink 8e0ab8cc61 Check for pg version >= 90200 before using PGRES_SINGLE_TUPLE 2014-07-03 22:58:04 +02:00
Joris Vink b2f31fbcdb remove balsy text 2014-07-03 22:41:56 +02:00
Joris Vink 83b7d64bc0 consistency 2014-07-03 22:40:55 +02:00
Joris Vink 5869f765b0 Update with more instructions 2014-07-03 22:40:12 +02:00
Joris Vink d4386195da Bring back pgsql_test.c 2014-07-03 22:40:03 +02:00
Joris Vink beee96cb03 Correct headers now that they are installed
While here, kill some MEDIA things for libs that
don't need it and such and such.
2014-07-03 22:39:32 +02:00
Joris Vink b6a778a4a5 Install kore headers under /usr/local/include/kore 2014-07-03 22:39:16 +02:00
Joris Vink d5cd89c544 s/kore_pgsql/pgsql and s/kore_tasks/tasks 2014-07-03 22:15:11 +02:00