| 1 | = !MapGuide RFC 63 - Introducing smart request queues to improve performance and stability = |
| 2 | |
| 3 | This page contains an change request (RFC) for the !MapGuide Open Source project. |
| 4 | More !MapGuide RFCs can be found on the [wiki:MapGuideRfcs RFCs] page. |
| 5 | |
| 6 | |
| 7 | == Status == |
| 8 | |
| 9 | ||RFC Template Version||(1.0)|| |
| 10 | ||Submission Date||(22.04.2009)|| |
| 11 | ||Last Modified||(UV Wildner) [[Timestamp]]|| |
| 12 | ||Author||(UV Wildner)|| |
| 13 | ||RFC Status||(draft)|| |
| 14 | ||Implementation Status||(discussion needed)|| |
| 15 | ||Proposed Milestone||(2.2?)|| |
| 16 | ||Assigned PSC guide(s)||(when determined)|| |
| 17 | ||'''Voting History'''||(vote date)|| |
| 18 | ||+1|||| |
| 19 | ||+0|||| |
| 20 | ||-0|||| |
| 21 | ||-1|||| |
| 22 | ||no vote|||| |
| 23 | |
| 24 | == Overview == |
| 25 | |
| 26 | In the current MapGuide Implementation the multithreaded server receives and processes concurrent requests for computing adjacent tiles. |
| 27 | This approach does not make clever use of the machine resources as the parallelization of those operations rarely speeds up the total |
| 28 | processing time. Therefore, e propose the introduction of smart request queue which can sort requests by Map & Scale. |
| 29 | |
| 30 | == Motivation == |
| 31 | |
| 32 | A memory limitation can cause the mapping / rendering service to abort rendering the tile before all features are determined. |
| 33 | Its very interesting that the serialization enforced by STDOUT of the debug build solves this problem already! |
| 34 | Returning the faulty tile without an error message is a defect (like #462) |
| 35 | However, this gives us as reason to suggest a redesign of the Tiling service. |
| 36 | |
| 37 | Basically, the server does not do anything efficient if we start to request mutliple tiles of the same map and scale at the same time. |
| 38 | This is like windows copying. If you start n parallel copy streams between the same disks you end up thrashing your disk. |
| 39 | |
| 40 | == Proposed Solution == |
| 41 | |
| 42 | 1. We therefore propose the introduction of smart request queue into the server which can sort requests by Map & Scale. |
| 43 | 2. The request queue serializes all tile requests and creates separate queues for each mapscale. |
| 44 | 3. A configurable multiplication factor can be set to ask the tileservice to compute larger tiles which are later sliced up into the requested small ones. Using a smart queue there is a way to block requests for those tiles to come in side the queue. |
| 45 | |
| 46 | This does not seem very hard to do and will improve performance and stability of the mapguide server dramatically. |
| 47 | |
| 48 | == Implications == |
| 49 | |
| 50 | This requires some thoughtful investigation of the queue structures in the ACE. I believe the LoadBalanceManager is a good starting point to look at doing this. |
| 51 | |
| 52 | 1. The queue needs to get another dimension based on map and scale information. |
| 53 | 2. Tileservice needs to get wrapped (subclassed) with an implementation [[BR]] |
| 54 | |
| 55 | a) which creates large request from the small tiles [[BR]] |
| 56 | |
| 57 | b) blocks existing requests for the same map and scale. (maybe even the lockfiles in the tile cache can serve this purpose.[[BR]] |
| 58 | |
| 59 | c) splits up the large tile (calling into new methods in the renderers)[[BR]] |
| 60 | |
| 61 | d) releases the blocked requests which are requesting tiles computed in the current request (usimg lockfiles in tilecache??)[[BR]] |
| 62 | |
| 63 | |
| 64 | == Test Plan == |
| 65 | |
| 66 | TBD |
| 67 | |
| 68 | == Funding/Resources == |
| 69 | |
| 70 | TBD |
| 71 | == closed Issues == |
| 72 | |
| 73 | NONE |
| 74 | |
| 75 | == open Issues == |
| 76 | |
| 77 | Design |
| 78 | |
| 79 | |
| 80 | == Suggestions == |
| 81 | |
| 82 | Please Comment. |