karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Achim Nierbeck <bcanh...@googlemail.com>
Subject Re: Using config admin to configure jetty (or tomcat?)
Date Wed, 19 Aug 2015 21:35:54 GMT
Hi Benson,

ok let me try to clear up some of the "smoke".
First of all Pax-Web is a standalone project which can be used standalone
with any osgi application.
Karaf itself does use Pax-Web as the webcontainer. Per default Jetty is
used as the underlying servlet container to serve web-content.
The pax-web-features jetty.xml is a default jetty.xml which can be used as
basis for customization.
Therefore the link to the jetty configuration documentation is correct as
it's better to link instead of embed those documentations.
If you want to apply those configurations you might need to take some extra
steps to achieve the same thing as with a
standard Jetty server. For example to add another Handler you'll need to
first call a get method for handlers where you can add your custom handler.
This differs to the way a standard jetty is configured.

Hope that clears up some of the confusion.

regards, Achim




2015-08-19 23:11 GMT+02:00 Benson Margulies <benson@basistech.com>:

> On Wed, Aug 19, 2015 at 5:05 PM, Achim Nierbeck <bcanhome@googlemail.com>
> wrote:
> > Hi Benson,
> >
> > I checked the docs, those are quite up to date.
>
> In the interests of my sanity / ability to be helpful, can you explain
> to me how
> https://karaf.apache.org/manual/latest/users-guide/webcontainer.html
> correlates to something in git@github.com:ops4j/org.ops4j.pax.web.git?
> I guessed that ./pax-web-features/src/main/resources/jetty.xml might
> be the relevant file, and that's why I thought there might be a
> discrepancy. Or am I barking up the wrong tree altogether?
>
> > But as Pax-Web uses an embedded jetty they'll need some extra care when
> > being used with pax-web.
> > some of those configurations need to use a slightly different syntax.
> >
> > regards, achim
> >
> >
> > 2015-08-19 22:48 GMT+02:00 Benson Margulies <benson@basistech.com>:
> >>
> >> I got the PAXWEB-868 parameters to work for me with custom.properties,
> >> and that's what I need.
> >>
> >> I leave it to JB to figure out whether the Karaf doc page I linked
> >> with the curious (to me) jetty.xml needs help.
> >>
> >> I used jolokia to spare myself further fighting with JMX and check on
> >> the thread count.
> >>
> >> thanks.
> >>
> >> On Wed, Aug 19, 2015 at 4:38 PM, Achim Nierbeck <
> bcanhome@googlemail.com>
> >> wrote:
> >> > Hi Benson,
> >> >
> >> > yes as I already mentioned you can also use a jetty.xml [1] to
> configure
> >> > the
> >> > container in addition to the configurations through config-admin
> >> > service.
> >> > Pax Web is a mediation layer, on top of Jetty, Tomcat and Undertow.
> >> > The jetty.xml you reference to is from the org.eclipse Jetty Project.
> >> >
> >> > Regarding your second question, about how to connect to a Karaf run
> >> > inside
> >> > Docker.
> >> > This depends if you expose the jmx port from inside of the docker
> >> > container
> >> > to the outside.
> >> > As I don't know about your Docker container for Karaf and how you
> >> > configured
> >> > it, it's hard to tell.
> >> >
> >> > If you exposed your jmx port, just follow the description in the
> manual.
> >> >
> >> > regards, Achim
> >> >
> >> > [1] -
> >> >
> >> >
> http://ops4j.github.io/pax/web/SNAPSHOT/index.html#_advanced_jetty_configuration
> >> >
> >> > 2015-08-19 22:18 GMT+02:00 Benson Margulies <benson@basistech.com>:
> >> >>
> >> >> Achim, the page I linked is from the latest karaf doc, and claims to
> >> >> be the default jetty.xml included in 'WebContainer', which I am
> >> >> supposing is pax-web.
> >> >>
> >> >> However, I looked in the repo for pax-web, and can't find a jetty.xml
> >> >> that looks like that. Or that defined a thread pool at all.
> >> >>
> >> >> I think I'll try to use the 868 new parameters.
> >> >>
> >> >> Meanwhile, have you ever managed to get jvisualvm connected to karaf
> >> >> in a docker container? All I want to do is see how many threads ...
> >> >>
> >> >> On Wed, Aug 19, 2015 at 4:07 PM, Achim Nierbeck
> >> >> <bcanhome@googlemail.com>
> >> >> wrote:
> >> >> > Hi Benson,
> >> >> >
> >> >> > I'm not sure I follow, but on the karaf manual page is no such
> >> >> > configuration.
> >> >> > With Pax-Web Jetty it's possible to have also the std. jetty.xml
> >> >> > configurations.
> >> >> >
> >> >> > since PAXWEB-868 it's also possible to use configurations via
> config
> >> >> > admin.
> >> >> >
> >> >> > regards, Achim
> >> >> >
> >> >> >
> >> >> > 2015-08-19 21:58 GMT+02:00 Benson Margulies <benson@basistech.com
> >:
> >> >> >>
> >> >> >> So, there's
> >> >> >>
> >> >> >>
> https://karaf.apache.org/manual/latest/users-guide/webcontainer.html,
> >> >> >> which shows a jetty.xml with an 'acceptors' parameter, not
a min
> and
> >> >> >> max threads. Is that page obsolete, or more up to date than
the
> page
> >> >> >> that led me towards:
> >> >> >>
> >> >> >> <Configure id="Server" class="org.eclipse.jetty.server.Server">
> >> >> >>     <!-- How many threads do we want? How do we want to
control
> load
> >> >> >> on an instance? -->
> >> >> >>     <Get name="ThreadPool">
> >> >> >>         <Set name="minThreads" type="int">10</Set>
> >> >> >>         <Set name="maxThreads" type="int">200</Set>
> >> >> >>         <Set name="idleTimeout" type="int">60000</Set>
> >> >> >>         <Set name="detailedDump">false</Set>
> >> >> >>     </Get>
> >> >> >> </Configure>
> >> >> >>
> >> >> >>
> >> >> >> On Tue, Aug 18, 2015 at 3:06 PM, Achim Nierbeck
> >> >> >> <bcanhome@googlemail.com>
> >> >> >> wrote:
> >> >> >> > no, it will work for both servers, it's just undertow
that works
> >> >> >> > differently.
> >> >> >> >
> >> >> >> > regards, Achim
> >> >> >> >
> >> >> >> > 2015-08-18 21:03 GMT+02:00 Benson Margulies
> >> >> >> > <benson@basistech.com>:
> >> >> >> >>
> >> >> >> >> OK, so if I pull in tomcat, I can configure the thread
pool
> size
> >> >> >> >> with
> >> >> >> >> config admin, but if I stick to Jetty, I am stuck
to XML.
> >> >> >> >>
> >> >> >> >>
> >> >> >> >> On Tue, Aug 18, 2015 at 2:52 PM, Achim Nierbeck
> >> >> >> >> <bcanhome@googlemail.com>
> >> >> >> >> wrote:
> >> >> >> >> > Hi Benson,
> >> >> >> >> >
> >> >> >> >> > in the manual [1] you can see the configurable
properties.
> >> >> >> >> > And we also had some improvement for configuring
threads for
> >> >> >> >> > the
> >> >> >> >> > http
> >> >> >> >> > service with 6 an 4.2 [2].
> >> >> >> >> >
> >> >> >> >> > regards, Achim
> >> >> >> >> >
> >> >> >> >> > [1] -
> >> >> >> >> >
> >> >> >> >> >
> >> >> >> >> >
> >> >> >> >> >
> >> >> >> >> >
> http://ops4j.github.io/pax/web/SNAPSHOT/index.html#Configuration-ConfigurationviaOSGiConfigurationAdminService
> >> >> >> >> > [2] - https://ops4j1.jira.com/browse/PAXWEB-868
> >> >> >> >> >
> >> >> >> >> > 2015-08-18 19:06 GMT+02:00 Benson Margulies
> >> >> >> >> > <benson@basistech.com>:
> >> >> >> >> >>
> >> >> >> >> >> I am wishing to use config admin, rather
than messing around
> >> >> >> >> >> with
> >> >> >> >> >> entire XML files in the file system or in
bundles, to
> >> >> >> >> >> configure
> >> >> >> >> >> the
> >> >> >> >> >> number of worker threads for the HTTP service.
Is there a
> way?
> >> >> >> >> >
> >> >> >> >> >
> >> >> >> >> >
> >> >> >> >> >
> >> >> >> >> > --
> >> >> >> >> >
> >> >> >> >> > Apache Member
> >> >> >> >> > Apache Karaf <http://karaf.apache.org/>
Committer & PMC
> >> >> >> >> > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/
> >
> >> >> >> >> > Committer
> >> >> >> >> > &
> >> >> >> >> > Project Lead
> >> >> >> >> > blog <http://notizblog.nierbeck.de/>
> >> >> >> >> > Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
> >> >> >> >> >
> >> >> >> >> > Software Architect / Project Manager / Scrum
Master
> >> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> > --
> >> >> >> >
> >> >> >> > Apache Member
> >> >> >> > Apache Karaf <http://karaf.apache.org/> Committer
& PMC
> >> >> >> > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
> >> >> >> > Committer
> >> >> >> > &
> >> >> >> > Project Lead
> >> >> >> > blog <http://notizblog.nierbeck.de/>
> >> >> >> > Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
> >> >> >> >
> >> >> >> > Software Architect / Project Manager / Scrum Master
> >> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> > --
> >> >> >
> >> >> > Apache Member
> >> >> > Apache Karaf <http://karaf.apache.org/> Committer &
PMC
> >> >> > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
> >> >> > Committer
> >> >> > &
> >> >> > Project Lead
> >> >> > blog <http://notizblog.nierbeck.de/>
> >> >> > Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
> >> >> >
> >> >> > Software Architect / Project Manager / Scrum Master
> >> >> >
> >> >
> >> >
> >> >
> >> >
> >> > --
> >> >
> >> > Apache Member
> >> > Apache Karaf <http://karaf.apache.org/> Committer & PMC
> >> > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
> Committer
> >> > &
> >> > Project Lead
> >> > blog <http://notizblog.nierbeck.de/>
> >> > Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
> >> >
> >> > Software Architect / Project Manager / Scrum Master
> >> >
> >
> >
> >
> >
> > --
> >
> > Apache Member
> > Apache Karaf <http://karaf.apache.org/> Committer & PMC
> > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer
> &
> > Project Lead
> > blog <http://notizblog.nierbeck.de/>
> > Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
> >
> > Software Architect / Project Manager / Scrum Master
> >
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Mime
View raw message