{"action":"created","issue":{"url":"https://api.github.com/repos/eerohele/dita-ot-gradle/issues/6","repository_url":"https://api.github.com/repos/eerohele/dita-ot-gradle","labels_url":"https://api.github.com/repos/eerohele/dita-ot-gradle/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/eerohele/dita-ot-gradle/issues/6/comments","events_url":"https://api.github.com/repos/eerohele/dita-ot-gradle/issues/6/events","html_url":"https://github.com/eerohele/dita-ot-gradle/issues/6","id":153275411,"number":6,"title":"Using the dita-ot-gradle plugin as the basis for a web service","user":{"login":"DavidPickles","id":9405336,"avatar_url":"https://avatars.githubusercontent.com/u/9405336?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidPickles","html_url":"https://github.com/DavidPickles","followers_url":"https://api.github.com/users/DavidPickles/followers","following_url":"https://api.github.com/users/DavidPickles/following{/other_user}","gists_url":"https://api.github.com/users/DavidPickles/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidPickles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidPickles/subscriptions","organizations_url":"https://api.github.com/users/DavidPickles/orgs","repos_url":"https://api.github.com/users/DavidPickles/repos","events_url":"https://api.github.com/users/DavidPickles/events{/privacy}","received_events_url":"https://api.github.com/users/DavidPickles/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eerohele/dita-ot-gradle/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"eerohele","id":31859,"avatar_url":"https://avatars.githubusercontent.com/u/31859?v=3","gravatar_id":"","url":"https://api.github.com/users/eerohele","html_url":"https://github.com/eerohele","followers_url":"https://api.github.com/users/eerohele/followers","following_url":"https://api.github.com/users/eerohele/following{/other_user}","gists_url":"https://api.github.com/users/eerohele/gists{/gist_id}","starred_url":"https://api.github.com/users/eerohele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eerohele/subscriptions","organizations_url":"https://api.github.com/users/eerohele/orgs","repos_url":"https://api.github.com/users/eerohele/repos","events_url":"https://api.github.com/users/eerohele/events{/privacy}","received_events_url":"https://api.github.com/users/eerohele/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2016-05-05T16:59:45Z","updated_at":"2016-05-06T07:28:04Z","closed_at":null,"body":"I have a question about the use of your plugin.\r\n\r\nI am looking at ways to expose DITA-OT through a web-service. (Every request will be for the same transtype, but the input ditamap and topic files will be different.) In the short term load will be quite light, but we need to have a roadmap for providing scalability as the load increases.\r\n\r\nOur as-is solution works by starting a JVM and kicking-off Ant for every request. Not surprisingly it takes quite a lot time. \r\n\r\nI've used your plug-in on my local machine to do the same DITA-OT processing, and with the Gradle daemon active seen really significant performance improvements. So this looks promising as the basis for an alternative to our current way of doing things on the server.\r\n\r\nMy question is whether this sounds like a reasonable approach to providing a web service. Are there any particular issues or risks that you think this approach would have that we should be aware of?\r\n\r\nThanks in advance for any thoughts you might have about this.\r\n\r\n\r\n\r\n "},"comment":{"url":"https://api.github.com/repos/eerohele/dita-ot-gradle/issues/comments/217369992","html_url":"https://github.com/eerohele/dita-ot-gradle/issues/6#issuecomment-217369992","issue_url":"https://api.github.com/repos/eerohele/dita-ot-gradle/issues/6","id":217369992,"user":{"login":"eerohele","id":31859,"avatar_url":"https://avatars.githubusercontent.com/u/31859?v=3","gravatar_id":"","url":"https://api.github.com/users/eerohele","html_url":"https://github.com/eerohele","followers_url":"https://api.github.com/users/eerohele/followers","following_url":"https://api.github.com/users/eerohele/following{/other_user}","gists_url":"https://api.github.com/users/eerohele/gists{/gist_id}","starred_url":"https://api.github.com/users/eerohele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eerohele/subscriptions","organizations_url":"https://api.github.com/users/eerohele/orgs","repos_url":"https://api.github.com/users/eerohele/repos","events_url":"https://api.github.com/users/eerohele/events{/privacy}","received_events_url":"https://api.github.com/users/eerohele/received_events","type":"User","site_admin":false},"created_at":"2016-05-06T07:28:04Z","updated_at":"2016-05-06T07:28:04Z","body":"Interesting idea!\r\n\r\nFirst off, I would recommend perusing [the documentation for Gradle Daemon](https://docs.gradle.org/2.5/userguide/gradle_daemon.html). Every caveat that applies to the Gradle Daemon naturally applies here, too.\r\n\r\nThere are some issues related to DITA-OT that you are probably already aware of that come to mind (no thread-safety, high memory consumption with large documents, etc.), but the first thing I can think of that pertains to this use case is that as the documentation for the Gradle Daemon says, a daemon instance dies after 3 hours of inactivity. So if your service has long periods of inactivity, you won't get much benefit out of the plugin, because it'll have to create a new daemon instance every time someone publishes something.\r\n\r\nLooking at the Gradle sources, it looks like there's a system property called `org.gradle.daemon.idletimeout` that you might be able to use to control the lifespan of the daemon, but I don't see that property documented anywhere, so it might be internal to Gradle and therefore subject to change.\r\n\r\nOn a somewhat related note, when I initially created this plugin, it didn't have to rely on any internal Gradle code. However, later DITA-OT added a dependency that's a different version of a library the Gradle runtime itself uses, which caused a conflict that forced me to basically rewrite the plugin to rely on a couple of internal Gradle classes in order to retain the benefit of using the Gradle Daemon.\r\n\r\nThat is not ideal and can lead to issues such as #5 (which you reported) when updating the Gradle version on the server. So, I would recommend testing each new Gradle version carefully before deploying into production. If there are any errors, you can naturally post an issue here and I'll try to get it fixed.\r\n\r\nAlso, the Gradle Daemon might slightly increase memory usage on your server, but I don't think it should be too much of an issue.\r\n\r\nOther than that, I don't know that anyone has used the plugin like this before, so you might bump into issues that I can't predict, of course. Again, though, if you post an issue, I'll try to help out."}}