* Added the possibility to provide ImageIO's output format in the TYPE string.
For instance:
TYPE=png image/png
TYPE=png image/png png256
TYPE=png image/png png24
TYPE=png image/png png
* Removed useless comments.
Added documentation for output format.
* Added tests for 'webp' output format
* Also added tests for 'png32' output format
* Fix 'webp' sums vary based on version
* Add JPG & use multiple layers on example-map
---------
Co-authored-by: Tim <autintim@gmail.com>
* Using [`GLib Logging Framework`](https://developer.gnome.org/programming-guidelines/stable/logging.html.en) for logging
* Created new `g_logger` function for logging
* Outputs to `stdout`/`stderr` only when running in `foreground`
* `stderr` for `message`, `warning`, `critical` & `error` levels
* `stdout` for `debug` & `info` levels
* Use `G_MESSAGES_DEBUG=all` environment to enable `debug` to print
* Otherwise, output will be to `syslog` or `systemd journal` (when appropriate)
* Standardized usage of `{LOG_PRIORITY}: ` prefix in log messages
* Only when using `syslog`, otherwise `GLib Logging` will take care of it
* Changed `fprintf(stderr`, `printf` & `perror` calls to `g_logger` calls
* You might want to check them out closely to make sure I chose the right levels
* No changes to `logging/output` were made to "`foreground`" programs (I.E. `render_*`)
* Changed `0`,`1` to `no_argument`,`required_argument` in `getopt_long`'s `long_options`
* Fixed `renderd`'s `foreground` opt (should be `no_argument` [0] rather than `reguired_argument` [1])
* Basic test for `mod_tile` module
* ~~Extended `renderd` log priority onto Mapnik's logger~~
select() has a well-known limit and the maximum file descriptor
that can be used (FD_SETSIZE). On Linux it is in most cases 1024.
Our renderd uses a lot of planet tiff files, so it had already
more than 1600 FDs for tiff files open. That means any new FD gets a
number bigger than that and using such FDs in select() leads to crashes
(because select() uses a fixed size bitmap).
The same can happen in mod_tile if the surounding web server is very
busy, altough it is less likely to happen there.
Changes in src/mod_tile.c:
- include poll.h
- poll timeout is an int containing miliseconds
- use "s > 0" instead of "s == 1" as success
(although it should never be >1)
- different log message for timeout and error case
Changes in src/daemon.c:
- remove include for sys/select.h
- replace connections array by new array pfd used in poll()
- include special FDs (exit and listen) at index 0 and 1 in this array
- no longer reorganize array while iteratig through it.
That would have led to items being skipped.
Instead mark array slots with fixed connections with
a negative FD. These are automatically skipped by poll.
Reuse these slots later when new connections come in.
- rename num_connections to num_cslots (initial segment
of the array that poll() should check) and
num_conns (number of slots in this segment, that are
actually used by connections; this number is only
used in logging).
- slightly enhance debug log lines
request doesn't fit into a rendering queue
RenderPrio, Render and RenderLow queues each only have a size of 32 entries. If these are full,
then requests overflow into the dirty queue. If this happens, renderd should send the NotDone
back immediately so that mod_tile doesn't wait for potentially a long time.
This however only worked for Render requests, but not RenderPrio or RenderLow. This patch fixes this.
In addition to Render and RenderPrio, add another priority level of RenderLow.
The idea is that if you rerender all tiles by touching planet-import-complete and
thereby likely overloading the server's rendering capacity you want to prioritize rerendering
of tiles that were explicitly marked dirty due to data changes over rerendering
due to planet-import-complete updates.
This is achieved by splitting rendering requests by if they are "old", or "very old".
As the tile expiry sets back the modification date many years, mod_tile splits
rendering requests based on how old the tiles are. If they are no more than a
certain threshold (currently set to one year) old, they are rendered with lower priority.