Are Apache and MySQL multithreaded applications? - mysql

I was wondering if the default installations of Apache and MySQL on Windows/Linux are multithreaded or not?

It depends on how to look at it.
MySQL allows you to run multiple threads at the same time (this comes to available CPU/RAM resources), but it won't allow you to run a single query using multiple threads.
Apache is multithreaded, this is the only way how the web application server could respond to multiple requests from different clients.

Yes, Apache and MySQL multithreaded.
By the way, they run as a single process on the server.

Yes. Servers have to be able to deal with many connections at once. Everything has to be on asynchronous threads.

Related

Setting up servers with fault tolerance using Go and MySQL (failover)

I am working in a project where we are using Go as a web server and MySQL.
We have been told to implement fault tolerance to handle a hardware crash. We were given 2 servers which have MySQL and the Go-server on them.
We have succesfully set up replication in MySQL, but we are struggling with the failover part. Our thought was to get an extra server with HAProxy to have a primary server and then being able to failover to the backup server.
We also considered using MySQL failover, but did not see how we could redirect the traffic using it.
Is this a reasonable plan? Or what would you recommend that we do instead?
If you want two identical servers connecting to their local MySQL instances, you need a way of deciding which one is the production server. There are a number of solutions for that, including
Setting up a reverse proxy, as you mention, but then, your proxy
itself becomes a SPOF,
Using a floating IP, also known as a failover
IP, but this only works if your host supports it. Cloud providers
typically support them, as well as some bare metal server providers.
There is nothing specific to Go as far as I know.

Setting up multiple instances of couchbase on fedora

I am trying to setup multiple instance of couchbase (couchbase-server-enterprise-4.5.0-DP1-centos7.x86_64.rpm)in fedora OS 21 .
I am following the steps in the below URL to setup the multiple instances of couchdb.
[http://docs.couchbase.com/admin/admin/Install/rhel-multiple-instances.html][1]
I have completed the first steps and able to launch couchbase in the http://localhost:8091/ui/index.html.
I have installed couchbase only once. Is it fine or do I need to install one more instance.
I am not sure how to proceed from step 2 onwards.
If I don't create any user defined ports in /opt/couchbase/etc/couchbase/static_config, will it be a problem?
I have setup nofile parameter as below in /etc/security/limits.conf file as mentioned in step 2.
Also, in the step 4 it is mentioned that, there is only one /opt/couchbase/etc/couchbase/static_config file. How can I setp different short_name parameter in that file.
How , once instance of couchbase identifies another instance of couchbase?
Couchbase really is much happier, and you will be too, to be on it's own OS, even if it is in something like Docker, VMs, etc. So I strongly recommend that you get something like Docker or VirtualBox to play with. Getting Couchbase to run multiple instances on the same OS is just not worth the hassle given the ease of other tools like I already mentioned.
That said, for development purposes, one of the best things about Couchbase is that you can develop on one node of Couchbase, but deploy against a much larger production cluster even with Multi-Dimensional Scaling enabled. It works very very well.

Connecting to Database on Virtual Machine?

Simple question can a Java service layer running on Tomcat7 on a host machine connect to persistent data store (mySQL) running inside a virtual box with portforwarding? I want to know if the hibernate or Jdbc connection strings from host machine work if mySQL server is installed inside a VirtualBox.
Also if it does work can I expect behavioral deviations in terms of speed and connection pooling if everything is packaged into one single system and deployed in a real world web server in a single enviroment?
The short answer is yes, it is possible and will work. You will likely have to play with the firewall settings on your virtual box instance. You don't specify OS, so it's hard to tell you what exactly you'll need to tweak.
As far as deploying this in a real-world environment, if you mean production, you probably should NOT do that. This is a great setup to build on, but not something I would run in production.
To be clear, there won't be any issues behaviorally speaking, it will act as MySQL always acts, but it will absolutely be slower than running it on 'bare metal' -- how much slower will vary based on hardware, workload, etc. and it is generally not a great design for a production deployment..

Run MySQL and PostgreSQL on same server

For our customer the application which is running is using MySQL database. However, this server is without monitoring. I want to install OpenNMS (which uses PostgreSQL) application to monitor the solution and send the traps to main NMS system.
Is there any problem having both on the same server?
No, there is no technical problem. Both default to different ports they listen on.
The only problem that could arise is that each individual DB might be slower compared to an installation on separate phyiscal machines because they are both share (and fight for) for the same resources (I/O, memory, CPU, network, ...)

watch requests between db server and client

Is there any tool which can monitor the requests and responses between a MySQL server and clients? Basically I want to know how many requests my web app makes to the mysql server and analyze the performance.
Is there any similar thing available for MSSQL server also?
Here is a bash script to monitor MySQL requests: http://blog.taragana.com/index.php/archive/monitoring-mysql-queries-using-bash-script/ And here is web-based variant of monitor: http://webyog.com/en/ (check out MONyog screenshots to understand is it really what you need).
Wireshark will do the trick. Wireshark is a general purpose protocol analyser and includes fitlers for a variety of applications including Mysql.
I've never used it myself, but MySQL proxy should do what you want.