Commit Graph

30 Commits

Author SHA1 Message Date
fe238926d4 Increase queue limits to reflect modern machines (#336) 2023-09-27 08:17:56 +02:00
f652ab1521 Configurable ImageIO output format (#318)
* 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>
2023-07-20 23:41:18 +02:00
6e20fba5e9 Generate config files and directories with CMake (#316)
* Generate config files and directories with CMake

CMake >= 3.13 required due to 'https://cmake.org/Bug/view.php?id=14444'

* Update CI pipeline
2023-07-20 23:34:21 +02:00
f4ee376b35 Build mod_tile with cmake 2023-03-01 11:57:10 +00:00
2325f84d1b Upgrade catch.hpp to Catch2 v2.13.9 2022-07-24 18:30:51 +00:00
296f888752 Resolve various compiler warnings and errors (#279)
* Resolved warnings in `src/daemon.c`

I.E.:
```
src/daemon.c:835:16: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   char *name = iniparser_getsecname(ini, section);
                ^~~~~~~~~~~~~~~~~~~~
src/daemon.c:860:20: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    char *ini_uri = iniparser_getstring(ini, buffer, (char *)"");
                    ^~~~~~~~~~~~~~~~~~~
```

* Resolved warning in `src/mod_tile.c`

I.E.:
```
./src/mod_tile.c:327:53: warning: format '%d' expects argument of type 'int', but argument 9 has type 'long unsigned int' [-Wformat=]
      ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, "request_tile: Failed to read response from rendering socket. Got %d bytes but expected %d. Errno %d (%s)",
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             ret, sizeof(struct protocol_v2), errno, strerror(errno));
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
                  |
                  long unsigned int
```

* Resolved `cppcheck`-detected error

I.E.:
```
src/store_rados.c:355:3: error: Memory leak: store [memleak]
  return NULL;
  ^
```

* Fix `Does not check for buffer overflows (CWE-120)` in `src/daemon.c`

* Fix `Does not check for buffer overflows (CWE-120)` in `src/cache_expire.c`

* Resolved `cppcheck`-detected error

I.E.:
```
src/parameterize_style.cpp:43:3: error: Memory leak: data [memleak]
  return;        //No parameterization given
  ^

* url is `char *`, unlike buffer, size is not known
2022-05-29 18:29:21 +00:00
42e4f0d283 Added PID file path configurability (#282)
* Added PID file path configurability
2022-05-26 20:36:54 +00:00
f0453c37d3 Allow connections over TCP besides Unix sockets
Signed-off-by: Stephan Austermühle <au@hcsd.de>
2022-01-06 20:32:50 +00:00
032d90d130 Reverted change of copyright owners on included source files 2021-08-17 14:43:40 +00:00
a14924a999 Logging Improvements
* 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~~
2021-07-28 14:46:50 +00:00
648913dec9 Formatted code as per Linux style 2021-02-15 19:20:30 +01:00
d706d96020 Clarify copyright holders 2020-10-09 15:20:37 +00:00
889a45b5e0 Use /var/cache instead of /var/lib for tiles 2020-10-09 07:52:15 +00:00
8d711039c8 Merge pull request #213 from xamanu/run-for-deamon
Adhere to FHS 3.0 and use daemon under /run.
2020-09-24 11:24:05 +01:00
de41cb1392 Adhere to FHS 3.0 and use daemon under /run. 2020-09-03 19:32:31 +00:00
a22065b8ae Move variables to prevent duplicates 2020-05-23 12:42:07 +01:00
1d43b86762 Merge branch 'master' of github.com:openstreetmap/mod_tile 2014-08-13 08:11:35 -07:00
7e9abfbb29 SCALE option to produce retina tiles 2014-07-09 18:23:41 +04:00
122adae7fb osx compile fixes 2014-05-23 14:09:13 -07:00
13da3afe70 render_list was not blocking on requests and would swamp renderd with requests 2013-12-24 01:03:20 +01:00
66e5538dc4 fix gcc errors 2013-12-05 17:47:04 +01:00
5dffe058e6 fix gcc errors 2013-12-05 16:35:49 +01:00
99357a53ab Improve backwards and forward compatibility for renderd protocol v3/v2 2013-10-20 16:03:32 -06:00
c4aabc5701 Enable mapnik style parameterization
Provide a parameterization function for internationalizing the names
2013-10-13 23:26:31 -06:00
e70bfafa20 Extend the storage backends to support options 2013-10-13 23:25:14 -06:00
5941e23ced Support options for tile layers in mod_tile.
If a tile layer has options enabled, the URL changes to

http://localhost/style/options/z/x/y.ext
2013-10-13 23:23:10 -06:00
fdc317a8f3 Update mod_tile to renderd protocol to version 3.
Include an "options" string and a "mimetype" string.
2013-10-13 23:22:08 -06:00
dd57fa7ea3 significantly increase the load thresholds after which mod_tile reduces rendering
sets the new MaxLoadMissing to 50 and MaxLoadOld to 16.

With the prevalence of multi core servers today, the previous
default thresholds of 10 and 5 were becoming to lower than the average
CPU count. Furthermore, load is not an ideal measure, as it includes I/O
load and much of the I/O load might well come from serving rather than
rendering. Especially if the database is on a separate SSD. Lastly, using
the thresholds in mod_tile isn't super helpful, as due to hysteresis of
 rendering queues stop submitting tiles at a time of high load is not
particularly helpful without stopping rendering from the queue.
2013-08-10 23:09:54 -06:00
1b4c56d8ed Add another priority level (RenderLow) to accommodate rerenders after style changes
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.
2013-08-10 23:05:28 -06:00
273973ed03 Clean up mod_tile directory by moving source files into a common src/ sub directory
also move includes into includes/
2013-08-09 18:46:10 -06:00