アプリ関連ニュース
- 2019年12月13日
- 技術情報
Apache VS Nginx
What is Apache?
Apache is a Web server released under the open source Apache 2.0 license. Like all Web servers, it hosts Web content – such as HTML pages, PHP files, and audio and video – and serves the content to users when they visit a website. It can host content for websites on the public Internet, or for internal company websites on an Intranet.
Since its early days, Apache has offered a variety of benefits that have made it a popular Web server solution for many IT and DevOps teams.
Apache also offers a modular plugin system that makes it easy to add functionality to an Apache installation by installing modules that enable Apache to serve different types of Web content, log information, compress data, and so on. Modules in Apache can be easily activated and deactivated, providing a flexible solution for extending and controlling how Apache behaves.
What is NGINX?
NGINX is a Web server that is designed to also work as a reverse proxy server, a load balancer, and an HTTP cache. NGINX is open source and governed by a BSD license. While Apache can be configured to perform these various additional tasks, it was designed first and foremost as simply a Web server.
NGINX offers many of the same benefits as Apache. It’s open source and (in its core open source form, at least) freely available to use.
Unlike Apache, however, NGINX has a somewhat simpler configuration system. Some of the functionality that would have to be added to an Apache installation using modules is included in NGINX by default, which means that there is less setup for admins to perform. For example, NGINX caches Web content by default in order to enable faster performance when multiple users request the same content.
Simplicity
Developing and innovating applications on Apache is easy. The one-connection-per-process model makes it very easy to insert modules at any point in its web serving logic. Developers could add code in such a way that if there were failures only the worker process running the code would be affected. Processing of all other connections would continue undisturbed.
NGINX, on the other hand, has a sophisticated architecture hence developing modules is not easy. NGINX module developers need to be very careful to create efficient and accurate code, without any failures, and to interact appropriately with the complex event-driven kernel to avoid blocking operations.
Performance
Performance is measured by how the server delivers large volumes of content to the client browser and this is an important factor. Content can be Static or Dynamic.
OS support
Apache runs on all operating systems such as UNIX, Linux or BSD and has full support for Microsoft Windows. NGINX also runs on several modern Unix-like systems and has support for Windows, but its performance on Windows is not as stable as that on UNIX platforms.
By Yuuma.
yuuma at 2019年12月13日 10:30:17
- 2019年12月12日
- 技術情報
CakePHP Windows10環境構築ガイド
nishida at 2019年12月12日 10:00:54
- 2019年12月11日
- Android
Android9以上でhttp平文通信を行う
tanaka at 2019年12月11日 10:00:43
- 2019年12月06日
- 技術情報
Lodash Js Array & Object – Part 3 (Final)
Today I will talk about dealing with array and object in Lodash Js.
Filter
- Filtering a list to transform the elements we want to get back
var numbers = _.range(0,10); // [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
var evenNumbers = _.filter(numbers, function(e){ return e % 2 != 0; });
// evenNumbers is now [ 0, 2, 4, 6, 8 ]
Reduce
- Reducing a list of objects to a single value.
- Ex=>A group of people can buy a meal or not. In that case we have to check out they have the enough amount by the sum of money they have.
- (Each’s money => sum money)
var ppl = [
{
'name': 'Keita',
'money': 1000
},
{
'name': 'Sato',
'money': 3000
},
{
'name': 'Ruma',
'money': 500
},
]
var sumMoney = function(data){
return _.reduce(
data,
function(accumulated, e){
return accumulated + e.money;
},
0
);
}
function canBuyMeal(data){
return 3500 < sumMoney(data);
}
canBuyMeal(ppl); // returns true
Some
- If there is at least one record in a collection that meets some criteria.
var ppl = [
{
'name': 'Keita',
'hasMoney': true
},
{
'name': 'Sato',
'hasMoney': false
},
{
'name': 'Ruma',
'hasProperty': true
},
]
function canLive(data){
return _.some(data, function(e){ return e.hasProperty; });
}
canGroupDrive(ppl); // returns true
Map
- Useful for changing a list into a different list in a purely declarative way.
- Can just specify how you want to manipulate an element of a list.
- Make a new list transformed by providing a function
var res1 = _.range(5); // [ 0, 1, 2, 3, 4]
var res2 = _.map(a, function(e){ return e + e;} );
//result is [0, 2, 4, 6, 8]
By Yuuma
yuuma at 2019年12月06日 11:00:39
- 2019年12月05日
- 技術情報
[php] printf sprintf vprintf vsprintf の違いについて(その2)
nishida at 2019年12月05日 10:00:45