Web Hosting Talk







View Full Version : Moving from PHP to Java?


rk2000
01-01-2002, 04:03 PM
I currently manage a PHP site that receives approximately 30,000 page views per month. I now have to upgrade the site to a more scaleable architecture utilizing XML and templates.

I am considering implementing the new architecture utilizing JSP and Servlets, but I have been having a difficult time finding an affordable and reputable Java host.

I am very happy with my current host (VenturesOnline) and am reluctant to move, but they don't offer Java as an option. Has anyone had experiences moving from PHP to Java? Is it worth moving to Java? Can anyone recommend any good hosts for around $40-50/month?

Just interested in getting some opinions from the 'pros' before going forward.

Thanks

bitserve
01-01-2002, 04:42 PM
I have never switched from PHP to JSP, but I can tell you from a system administrator stand point that JSP seems to use a lot more resources on our servers than PHP does.

However, just Java CGI programs (servlets) do run pretty fast and don't use up a lot of resources.

priyadi
01-01-2002, 06:18 PM
JSP (and Java in general) is quite unpopular in shared hosting. I think it is because JSP is hard to configure for shared environment use.
It is also a resource hog, and unpopular as well, It is like only one in two hundred clients ask for servlet/JSP here.

In my opinion, it is not worth migrating to Java. For high load sites PHP is your best bet.

If you really really need JSP, consider using a dedicated server.

RamonaUhl
01-01-2002, 09:48 PM
I haven't worked much with PHP, so I can't address migration, but using a combination of JSP and servlets and the well known Model-View-Controller architecture is a great way to implement highly scalable systems. That architecture lets you separate logic and presentation so it's easier to maintain the site.

As far as hosting services, I currently use CWI Hosting for JSP/servlets. They have come under some fire here on WHT, but I have had pretty good luck with them. With your load, you'll want to be sure to find a host that gives you a private Java Virtual Machine (JVM) (or a dedicated host).

Joel Barnum
descriptor.com

ckpeter
01-01-2002, 11:11 PM
JSP and servlet are initially very resource intensive. However, once you get pass a certain point of load, the performence becomes much better, this is because of the small overhead of adding load. Furthermore, java/servlet offer huge scalability and distributability.

It will be best if you use a dedicated server. However, Java is rather difficult to configurate. If you can afford, get a private JVM.

One that comes to mind is the sponsor of jdom.org. Go to the site and you should see the sponsor's logo.

Peter

bteeter
01-01-2002, 11:27 PM
Originally posted by rk2000
I currently manage a PHP site that receives approximately 30,000 page views per month. I now have to upgrade the site to a more scaleable architecture utilizing XML and templates.

I am considering implementing the new architecture utilizing JSP and Servlets, but I have been having a difficult time finding an affordable and reputable Java host.

I am very happy with my current host (VenturesOnline) and am reluctant to move, but they don't offer Java as an option. Has anyone had experiences moving from PHP to Java? Is it worth moving to Java? Can anyone recommend any good hosts for around $40-50/month?

Just interested in getting some opinions from the 'pros' before going forward.

Thanks

We went through an evaluation of PHP and JSP before building the current version of our site. We chose to go with JSP - and it has been a great decision. We run Tomcat for our JSP/Servlet engine and see excellent performance. We also connect to a MySQL backend, with no problems or performance issues.

Although Java isn't a popular technology in shared hosting, we use it and offer it. It really isn't that hard to setup - especially in a CPanel environment like we use. Any host that runs CPanel should be able to setup JSP/Servlets in about 1/2 hour per server, and thereafter a couple of minutes per account.

Our corporate web site is on a server with about 20 of our clients. The load sits typically at 0.05 - 0.10 - even when our site is under high traffic. No performance issues now, and we don't anticipate any going forward. We are considering upgrading memory on that server - but we won't do that until we get about 40 accounts on it. With the low level of load it has now, it doesn't need it. When we do add more though, I anticipate that the JSP/Servlet engine will see the most benefit since Apache is such a slim web server.

I'd definitely recommend you go with JSP. There are A LOT of resources out there for JSP development, and there are a lot of class libraries that you can use. Also, Sun's Javadoc is an absolute godsend, not only for the built in libraries, but for any 3rd party - or self generated classes. I've yet to see an automatic code documentation generator so useful and powerful. :)

Perhaps you should put a request in the "Requests" forum, so hosts can offer you their services.

Take care,

Brian

priyadi
01-02-2002, 02:37 AM
Originally posted by bteeter

Although Java isn't a popular technology in shared hosting, we use it and offer it. It really isn't that hard to setup - especially in a CPanel environment like we use. Any host that runs CPanel should be able to setup JSP/Servlets in about 1/2 hour per server, and thereafter a couple of minutes per account.


Hello,

I am interested in offering JSP to our customer. However after our evaluation, JSP is not easy to install securely in shared environment. If we want security (and privacy) we need to run a single JVM for each user, which is a resource waste.

My question is, do you use a single JVM or multiple JVM one for each customer? I do know that when running in a single JVM, every JSPs are executed with the same UID, which is a security/privacy risk. It is like running CGI scripts without suEXEC. So, how would you manage to secure JSP? Do I miss something here?

astralexis
01-02-2002, 04:05 AM
interesting thread...

if in this context someone has info on jBoss.org, what it adds to the bare JSP/Servlet environment, if it's easy to set up in combination with Tomcat and what is their relation etc. that would be yet more interesting...

TimPD
01-02-2002, 04:20 AM
I always used php and never switched from java. Sorry i'm no help.

bteeter
01-02-2002, 09:38 AM
Originally posted by priyadi


Hello,

I am interested in offering JSP to our customer. However after our evaluation, JSP is not easy to install securely in shared environment. If we want security (and privacy) we need to run a single JVM for each user, which is a resource waste.

My question is, do you use a single JVM or multiple JVM one for each customer? I do know that when running in a single JVM, every JSPs are executed with the same UID, which is a security/privacy risk. It is like running CGI scripts without suEXEC. So, how would you manage to secure JSP? Do I miss something here?

JSP and Servlet's run in their own VM for each customer.

Certainly, there could be a security risk with JSP/Servlets, but no more than with CGI-scripts. I'm not sure how you could secure the JVM's other than getting Jakarta Tomcat (in our case) to run each JVM as the owner's UID. I wonder if that is possible... It is certainly something I will need to look into.

Take care,

Brian

bteeter
01-02-2002, 09:42 AM
Originally posted by astra4
interesting thread...

if in this context someone has info on jBoss.org, what it adds to the bare JSP/Servlet environment, if it's easy to set up in combination with Tomcat and what is their relation etc. that would be yet more interesting...

JBOSS is a free, open source EJB container. EJB = Enterprise Java Beans. EJB's are an excellent technology for developing server side software. Many large corporate web sites use them, and many professional/corporate web applications which need to operate on a large scale use them. EJB's are very scalable, include a wealth of features and make the developer's job a whole lot easier. Many things like Transaction Management, connection pooling, Object/Relational mapping are all done for you.

If you want to learn more about EJB's check out java.sun.com.

As far as finding a host who offers JBOSS, I don't know of any. EJB's are truly resource intensive. JBOSS is easy to integrate with Tomcat, so if someone were so inclined, they could set it up on their server. I don't know how well it would work in a shared environment though. It is probably best suited for a dedicated environment.

Take care,

Brian

bobcares
01-02-2002, 11:37 AM
My question would be what are the benifits of JSP/Servlets over php.
If there are any specific reason only then you must switch otherwise php is a real cool language... :)

PHP to has suport for XML. templates etc....
It is very feature rich...

Java as such does not give you any particular benifits. Moreover the end user would never see the difference. So why waste time and money on nothing...

It's just my personal opinion.

Have a great day :)

regards
amar

rk2000
01-02-2002, 12:06 PM
Believe me it's an issue that I have been debating for the past month. Some of my partners are pushing for Java/JSP and I had to spent the last two months learning Java and Servlets, just in case.

I agree with the other posts that Java Servlets are a very powerful and scaleable technology. But in my opinion, I agree with Amar, that its hard for me to justify the cost of moving to Java instead of just doing the required XML upgrades in PHP. PHP 4.1 also just added a wealth of new features including built in XSLT support that I have to look into more.

The major reason I have for not wanting to move to Java is the lack of options in the host market. I am comfortable with the fact that if my current shared host had to close shop for any reason :bawling: , I could easily find another PHP host. Java hosts, on the other hand, are much more limited and that increases the risk (and price). And I can't justify the cost of a dedicated server yet ....

Thanks,
rk

bteeter
01-02-2002, 01:48 PM
I understand where your coming from. But, consider the amount of code that exists for Java vs. PHP out of the box. Java has thousands of pre-built classes in the basic JDK. Beyond that, there is code everywhere on the Net that you can use. Tutorials are all over the net

You want XML and XSLT, visit http://jakarta.apache.org, or http://www.apache.org. The Apache project has a ton of free XML utilities for Java like Xerces, etc.

I'm a big fan of Java. Its easy to use and learn, and is extremely powerful. PHP is nice, but its syntax isn't as clean, and it isn't truly object orinted as Java is.

Take care,

Brian



Originally posted by rk2000
Believe me it's an issue that I have been debating for the past month. Some of my partners are pushing for Java/JSP and I had to spent the last two months learning Java and Servlets, just in case.

I agree with the other posts that Java Servlets are a very powerful and scaleable technology. But in my opinion, I agree with Amar, that its hard for me to justify the cost of moving to Java instead of just doing the required XML upgrades in PHP. PHP 4.1 also just added a wealth of new features including built in XSLT support that I have to look into more.

The major reason I have for not wanting to move to Java is the lack of options in the host market. I am comfortable with the fact that if my current shared host had to close shop for any reason :bawling: , I could easily find another PHP host. Java hosts, on the other hand, are much more limited and that increases the risk (and price). And I can't justify the cost of a dedicated server yet ....

Thanks,
rk

ckpeter
01-02-2002, 01:54 PM
Originally posted by bobcares
My question would be what are the benifits of JSP/Servlets over php.
If there are any specific reason only then you must switch otherwise php is a real cool language... :)

PHP to has suport for XML. templates etc....
It is very feature rich...

Java as such does not give you any particular benifits. Moreover the end user would never see the difference. So why waste time and money on nothing...

It's just my personal opinion.

Have a great day :)

regards
amar

I am not a php programmer, all I did was looking at a few lines of php code, but I thought I would share some on that,

PHP is a very cool language, I agree.

However, Java is more of an enterprise-class language. First of all, its portable, from windows to unix to anything else. Java is more portable than php.

It is also more scalable and distributable. I am not exactly sure on how php is on these ends, but I think java is more so.

Also, while in the webhosting industry many people are using php. In the broader context java is the more popular language. It also has amazing API support for anything you can possibly imagine.

I am sure there are other differences.

PHP is the tool for a small to medium site. However, for an enterprise level, java will be more suitable to the job. Each tool has its own use, and using java for a simple 5 page site is not very practical. Whether java deliver the benefits depends on what use you do with it.

Peter

rk2000
01-02-2002, 02:34 PM
I agree that Java is powerful and has great cross-platform capabilities.

But how much bandwidth and disk space can I get from a Java host for around $30 / month? (I am currently getting 20GB Bandwidth and 500MB of space.)

I'm not sure of the forum rules, but can anyone list around 5 solid Java hosting options with a similar configuration for under $50/month and how long they have been in business. They only one I have found with a similar package is CQHost, but they never responded to any of my emails (I sent three within a month) so I'm not sure how to proceed.

I spent all alot of time learning Java, so I would like to use it, but PHP definitely does the job and I have been able to find numerous free code libraries and 90% of what is needed is already built into the language.

Regarding the cross platform issue. I do all of my development work on a local Windows development machine runnning Apache and PHP4 and I upload to a Linux server without many glitches. (the only issue is usually with the file paths)

Thanks,
rk

ckpeter
01-02-2002, 02:47 PM
Java hosts are going to invariably charge you more for diskspace and bandwidth, why? becuase,

-since you are using java, they assume you are a big site rich with lots of money.
-the difficulty in configurating java
-processing power: most host don't charge you processing power, that's because they factor that into the bandwidth and diskspace charges, so with java, the factor is bigger
-many others...

If you want directly offer, post a request in the ad forum. java hosts will contact you.

PHP is definitely more than enough for the vast majority of big sites.

Looking at your situation, I think you are looking at the wrong options. You don't need java or xml, what you really need is dedicated hosting. You haven't outgrown php to use java; you have outgrown shared hosting.

My recommendation would be to get a dedicated server, and continue to use php. otherwise using shared hosting, your java/xsl site will still run slow.

Peter

astralexis
01-02-2002, 03:26 PM
Hmmm... I also would like to know about the JSP/Servlets hosting offers. Couldn't you (any moderator) allow an exception to the "ad forum" rule for this particular case? I mean, there isn't a huge lot of JSP/Servlets hosts anyway,... And since the "web hosting requests" forum doesn't allow the hosts to post public replies anymore,...

Anyway, a really low cost one I have come accross is downtownhost.com (http://www.downtownhost.com), but they aren't experienced with JSP/Servlet yet, I think, the entire company is relatively young, but still it might be great for a hobby user like myself ;)

All others I've seen are pretty much more expensive

ckpeter
01-02-2002, 03:45 PM
If this has not been mentioned: focalhosting does jsp hosting.

also, wantjava.com does it as well.

Peter

bteeter
01-02-2002, 04:11 PM
Java or not, you've got a pretty good deal at $30/month. I'd be happy to talk to you privately about what we can offer you at $30/month with Java included. (Or if the moderators weigh in and say we can talk about it publically here, I'd be happy to do that as well.)

If you are really using all of that 20GB per month (ie. you would need to have it in your plan), I think you may have a hard time getting a Java plan that includes that much bandwidth for just $30 - from us - or from just about anyone else. Disk space is almost never an issue. 500mb is no big deal, its the bandwidth that is expensive. :-)

Take care,

Brian


Originally posted by rk2000
I agree that Java is powerful and has great cross-platform capabilities.

But how much bandwidth and disk space can I get from a Java host for around $30 / month? (I am currently getting 20GB Bandwidth and 500MB of space.)

I'm not sure of the forum rules, but can anyone list around 5 solid Java hosting options with a similar configuration for under $50/month and how long they have been in business. They only one I have found with a similar package is CQHost, but they never responded to any of my emails (I sent three within a month) so I'm not sure how to proceed.

I spent all alot of time learning Java, so I would like to use it, but PHP definitely does the job and I have been able to find numerous free code libraries and 90% of what is needed is already built into the language.

Regarding the cross platform issue. I do all of my development work on a local Windows development machine runnning Apache and PHP4 and I upload to a Linux server without many glitches. (the only issue is usually with the file paths)

Thanks,
rk

astralexis
01-02-2002, 05:16 PM
WantJava.com (http://www.wantjava.com/prices.jsp?myPackage=Espresso) looks nice, but have you seen these prices? Frankly, 99$/month with 1Gig traffic and 50 MB disk space,... want an additional 30 MB of disk space? No problem, it's just another 50$/month!!!!!!! That's insane, isn't it?

I don't see why I wouldn't get my own server and install everything I please, at that price,... frankly.

FocalHosting looks more reasonable to me.

astralexis
01-02-2002, 05:31 PM
Originally posted by bteeter
(Or if the moderators weigh in and say we can talk about it publically here, I'd be happy to do that as well.)

Oh - well, I didn't mean the details, just it would be interesting to get a list of hosts who do the JSP/Servlet thing and maybe jBoss, I don't quite know what it's good for, but that's usually the things I want most :)

rk2000
01-02-2002, 05:59 PM
I could budget at most $50/month for a good Java host, but no more at the current moment. I've been looking into focalhosting, servlets.com, CWIHosting, CQHost, and RackShack.net.

Their prices all vary significantly, but here is what I have found so far. CQHost offers a great package but never responds to any questions. Servlets.com seems very expensive. I'm a little afraid to consider CWIHosting based upon recent discussions on this board. FocalHosting offers a nice package, not as much bandwidth but a private JVM and JBoss support. Does anyone know what kind of reputation RackShack has? Their prices seem pretty low for a dedicated server.