Newbie Questions about Tomcat and Load Balancing

478 views
Skip to first unread message

James Lampert

unread,
Apr 6, 2017, 8:04:41 PM4/6/17
to gce-discussion
Greetings.

I'm involved in a project to build an application on Google Cloud, and I've been asked to learn all I can about relevant services.

The project involves a webapp that runs in a Tomcat server, and connects to a MySQL database server.

Currently, for development purposes, we're running both Tomcat and MySQL locally, on a beat-up old P3 Linux box, but the goal is to migrate everything to Google Cloud.

I think I've got a fair understanding of what needs to happen for the database, but I'm having trouble with Tomcat.

First, can anybody tell me what the advantages and disadvantages are with using Bitnami's pre-installed Tomcat image vs. installing Tomcat myself on a base Compute Engine Linux image?

And second, does Google HTTPS load balancing work with Tomcat? If so, where can I find information specific to this?

--
James H. H. Lampert

Marilu (Cloud Platform Support)

unread,
Apr 7, 2017, 12:42:03 PM4/7/17
to gce-dis...@googlegroups.com
Hi James,

The Google Cloud Launcher helps users to quickly deploy build solutions in just a few clicks, making the deployment pretty easy. When deploying this kind of solutions, if a password has been configured for the services, it's recommended to change the temporary password. It will be up to customers if they want to change the default admin username. You can refer to these other links [1][2], to find more info about Bitnami Tomcat.

Installing Tomcat on a Google Compute Engine(GCE) instance it is also a valid way to go, if you rather manage Tomcat configuration by yourself.

Regarding your question about Google HTTPS Load Balancer, it's designed for HTTPS requests, so this will work with Tomcat. 

I'll recommend setting up your Tomcat on a GCE instance; once the instance is up and running, you can use this instant to create a managed instance group that can be used for configuring the backend service of your load balancer. At this link, you can find an example on how to configure a Cross-Region load balancer, the backend instances in this example are running an Apache web server.

You can also review the autoscaler feature on GCE, this will allow you to autoscale your application when required. Since this required to have multiple identical servers as part of your managed instance groups, you can consider using instance templates

You can review these other videos: Creating Managed Instance Group TemplatesCreate Managed Instance GroupIntroduction to Load Balancing and Learn how to scale your applications with Google Compute Engine, that quickly explains how to setup all these services on GCE. 

I hope this helps.

Marilu

James Lampert

unread,
Apr 7, 2017, 3:26:03 PM4/7/17
to gce-discussion
Thanks. That helps a great deal, and it looks like I've got enough material to look at to keep me busy for the rest of the day.

James Lampert

unread,
Apr 10, 2017, 12:06:17 PM4/10/17
to gce-discussion
On Friday, April 7, 2017 at 9:42:03 AM UTC-7, Marilu (Cloud Platform Support) wrote:

This last one uses a Network Load Balancer, rather than an HTTP(S) Load Balancer. I'm not quite sure I understand the reasoning on this choice. I also note that it has two layers of server (front-end and back-end) between user and database; our product-in-development has only one layer of server between the user's browser and the database.

Also, with regard to load balancing, the nature of the application involves signed-on sessions, and we would want the clustering set up to (barring a failover) keep established sessions on the same Tomcat instance on which they were initially signed on. How does that affect the choice of load balancer, and the autoscaler?

--
JHHL

Marilu (Cloud Platform Support)

unread,
Apr 11, 2017, 10:27:22 AM4/11/17
to gce-discussion
Hi James,

That video I provided is a bit old, since then we have lots of new updates.

I'm providing some more information regarding the type of load balancers on GCE:

1. HTTPs Load balancer is designed for HTTP(s) requests. When choosing this kind of load balancer you can also:
   - Configure URLs to determine the appropriate backend service for the requests based on the URL path.
   - It is a global load balancer, so uses global forwarding rules.
   - It is possible to setup session affinity based on ‘Client IP affinity’ or ‘Generated cookie affinity’ when configuring the backend. This affinity can be updated at any time on the backend service.
   - Google CDN (Content Delivery Network) works only with this kind of load balancer.
   - It is possible to configure SSL certificates for HTTPs to handle the requests securely.
   - it does not support WebSocket connections

2. Network load balancer(NLB) balances any kind of TCP/UDP traffic on a specific region, so:  
   - It’s a regional load balancer and uses forwarding rules in conjunction with target pools. 
   - Target pools can have session affinity defined on ‘CLIENT_IP_PROTO’ or ‘CLIENT_IP’. This value is setup during creation of the target pool. Once set, it's not possible to change it. 
   - It does support WebSocket connections.

3. There's also SSL proxy  and TCP proxy for Google Cloud Load Balancing, but this is intended for non-HTTP(S) traffic.

As you will see, HTTPs load balancer is recommended for HTTPs traffic. 

Regarding the layers of servers, this is up to customers to determine which will be the best approach for their services. The video is just to give you an idea of how the setup works, but you can choose what would be best for your case.

I hope this clarifies better your question.

Marilu

James Lampert

unread,
Apr 11, 2017, 5:34:38 PM4/11/17
to gce-discussion
On Tuesday, April 11, 2017 at 7:27:22 AM UTC-7, Marilu (Cloud Platform Support) wrote:
I'm providing some more information regarding the type of load balancers on GCE:

Looking at the pricing chart on that page, I'm not entirely sure I understand it:

"Hourly service charge." "Hourly" with regard to what? With regard to total time that the load balancer is online? 2 1/2 cents per hour would work out to $219 per year, whether there's any actual load being balanced or not. 

Marilu (Cloud Platform Support)

unread,
Apr 12, 2017, 4:56:25 PM4/12/17
to gce-discussion
Hello James,

This is correct as per our Load balancing and protocol forwarding prices list. The estimation will be for up to five forwarding rules. I'll suggest to use our Google Cloud Platform Pricing Calculator to estimate your monthly charges, you can estimate the cost of GCE instances, persistence disks and load balancing.

James Lampert

unread,
Apr 14, 2017, 7:57:56 PM4/14/17
to gce-discussion
Thanks.

One other newbie question:

The Tomcat servers we're using for development on this project are a rather superannuated CentOS box that's a 1 GHz P3 with 256k of cache, 1G of memory, and 14.5G of disk, and Tomcat running in Eclipse on our own individual boxes (in my case, a 2.5GHz 2-core Mac Mini with 4G of memory and 500G of disk.

I'm guessing that even the smallest Compute Engines you offer are a good deal bigger and faster than these, but I'm not clear on how much bigger and faster. Is there someplace I can find information on comparative performance?

Marilu (Cloud Platform Support)

unread,
Apr 18, 2017, 9:51:21 AM4/18/17
to gce-discussion
Hello James,

I'll suggest reviewing this link for more information on the available machine types on GCE, as well as this other link to find out more about persistence and SSD disk performance, in here you will also find a comparison of a persistent disk to a physical hard drive.
Reply all
Reply to author
Forward
0 new messages