All streams
Search
Write a publication
Pull to refresh
-1
0

User

Send message
многие сомневаются в необходимости математики, т.к. не видят ей практическое применение, я профессионально занимаюсь разработкой софта уже лет десять и с уверенностью могу сказать, что 95 процентам программистов не нужна математика сложнее 5го класса
а чего во всех ссылках на roadmap jdk8 и 9? и будет ли valhalla? не вижу этого проекта в списке фич =(
за что нам такое счастье? неужели нет другого способа в базу ходить?

А я вот после двух с половиной лет коммитов на гитхаб забросил это дело — никому не нужны кастомные проекты =(

да, мне было скучно, я поднял 40 виртуальных машин для клиентских приложений и одну виртуалку для сервера, 40 клиентов по 20к коннектов = 800к клиентских коннектов, и на сервере — 800к серверных, оперативы сожрало примерно 12 гигов, но все уперлось в старенький амд.
На таком количестве коннектов проц только занимался обработкой эвентов на соединениях и все было довольно неспешно, на 500к клиентов все работало прекрасно и проц не напрягался
оверхед на вебсокетах минимальный — пара байт для размера сообщения, что-то аналогичное все равно придется писать для обычных сокетов, а тут оно есть из коробки
А будет ли успешно работать сервис при, допустим, 10000 соединений? Есть у кого-нибудь такой опыт?

я поднимал на домашнем компе 1.6кк коннектов, работало, но cpu был занят обработкой сети, на 10к проблем быть не должно, но зависит от имплементации сервера

я не спец по котлину, но 9ый и 10ый пазлеры для меня выглядят как бага языка

по результатам этих тестов php 7 быстрее, чем php 5.6, но в два раза медленнее nodejs 6

По итогам теста PHP 7 быстрее.

быстрее чем что?

а riotjs не пробовали?

я правильно понимаю, что вызов send в первой задаче неблокирующий? что произойдет, если отправить одно сообщение и, не дожидаясь результата, отправить следующее?

а есть счетчик коммитов, количество дней подряд, как раньше на гитхабе?

количество воркеров смогу проверить только вечером, но точно помню, что нода юзала все 4 потока, учитывая, что у проца всего два ядра, 30к — ожидаемый результат

нода у меня версии v5.3.0, в один поток 16к рпс, в режиме кластера — 30к, старенький томкат 7.0.55 — 45к, мой кастомный сервер — 136к рпс — сишный сокет-сервер, обернутый в jni, вся логика по обработке http написана на java. Запускал на ноутбуке с i7-3517U (2 ядра, 4 потока), java 1.8.0_92

node
ab -n 1000000 -k -c 16 http://localhost:8081/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 100000 requests
Completed 200000 requests
Completed 300000 requests
Completed 400000 requests
Completed 500000 requests
Completed 600000 requests
Completed 700000 requests
Completed 800000 requests
Completed 900000 requests
Completed 1000000 requests
Finished 1000000 requests

Server Software:        
Server Hostname:        localhost
Server Port:            8081

Document Path:          /
Document Length:        11 bytes

Concurrency Level:      16
Time taken for tests:   32.601 seconds
Complete requests:      1000000
Failed requests:        0
Keep-Alive requests:    1000000
Total transferred:      137000000 bytes
HTML transferred:       11000000 bytes
Requests per second:    30673.57 [#/sec] (mean)
Time per request:       0.522 [ms] (mean)
Time per request:       0.033 [ms] (mean, across all concurrent requests)
Transfer rate:          4103.79 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       2
Processing:     0    1   0.8      0      19
Waiting:        0    0   0.8      0      19
Total:          0    1   0.8      0      20
WARNING: The median and mean for the processing time are not within a normal deviation
        These results are probably not that reliable.
WARNING: The median and mean for the total time are not within a normal deviation
        These results are probably not that reliable.

Percentage of the requests served within a certain time (ms)
  50%      0
  66%      0
  75%      1
  80%      1
  90%      1
  95%      1
  98%      3
  99%      5
 100%     20 (longest request)

tomcat
ab -n 1000000 -k -c 16 http://localhost:8080/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 100000 requests
Completed 200000 requests
Completed 300000 requests
Completed 400000 requests
Completed 500000 requests
Completed 600000 requests
Completed 700000 requests
Completed 800000 requests
Completed 900000 requests
Completed 1000000 requests
Finished 1000000 requests

Server Software:        Apache-Coyote/1.1
Server Hostname:        localhost
Server Port:            8080

Document Path:          /
Document Length:        12 bytes

Concurrency Level:      16
Time taken for tests:   22.190 seconds
Complete requests:      1000000
Failed requests:        0
Keep-Alive requests:    990006
Total transferred:      183950030 bytes
HTML transferred:       12000000 bytes
Requests per second:    45066.05 [#/sec] (mean)
Time per request:       0.355 [ms] (mean)
Time per request:       0.022 [ms] (mean, across all concurrent requests)
Transfer rate:          8095.61 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       1
Processing:     0    0   3.4      0     808
Waiting:        0    0   3.3      0     808
Total:          0    0   3.4      0     808

Percentage of the requests served within a certain time (ms)
  50%      0
  66%      0
  75%      0
  80%      0
  90%      1
  95%      1
  98%      1
  99%      1
 100%    808 (longest request)

мой кастомный сервер (1 поток)
ab -n 1000000 -k -c 16 http://localhost:10240/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 100000 requests
Completed 200000 requests
Completed 300000 requests
Completed 400000 requests
Completed 500000 requests
Completed 600000 requests
Completed 700000 requests
Completed 800000 requests
Completed 900000 requests
Completed 1000000 requests
Finished 1000000 requests

Server Software:        
Server Hostname:        localhost
Server Port:            10240

Document Path:          /
Document Length:        11 bytes

Concurrency Level:      16
Time taken for tests:   7.320 seconds
Complete requests:      1000000
Failed requests:        0
Keep-Alive requests:    1000000
Total transferred:      113000000 bytes
HTML transferred:       11000000 bytes
Requests per second:    136620.03 [#/sec] (mean)
Time per request:       0.117 [ms] (mean)
Time per request:       0.007 [ms] (mean, across all concurrent requests)
Transfer rate:          15076.23 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       1
Processing:     0    0   0.0      0       3
Waiting:        0    0   0.0      0       3
Total:          0    0   0.0      0       3

Percentage of the requests served within a certain time (ms)
  50%      0
  66%      0
  75%      0
  80%      0
  90%      0
  95%      0
  98%      0
  99%      0
 100%      3 (longest request)

30k rps, томкат еще медленный довольно, могу запустить в своем хттп-сервере в один поток, будет примерно 150к

было бы чего добиваться, hello world на nodejs работает в 3 раза медленнее, чем аналогичный сервлет в томкате.


hello.js
var http = require("http");

http.createServer(function (request, response) {
   response.writeHead(200, {
    'Content-Type': 'text/plain', 
        'Connection': 'Keep-Alive',
        'Content-length': 11
   });

   response.end('Hello World');
}).listen(8081);

hello.java
package hello;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class HelloServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
      response.setContentType("text/plain");
      PrintWriter out = response.getWriter();
      out.println("Hello World");
    }
}

benchmark nodejs
ab -n 100000 -k -c 16 http://localhost:8081/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests

Server Software:        
Server Hostname:        localhost
Server Port:            8081

Document Path:          /
Document Length:        11 bytes

Concurrency Level:      16
Time taken for tests:   6.167 seconds
Complete requests:      100000
Failed requests:        0
Keep-Alive requests:    100000
Total transferred:      13700000 bytes
HTML transferred:       1100000 bytes
Requests per second:    16215.09 [#/sec] (mean)
Time per request:       0.987 [ms] (mean)
Time per request:       0.062 [ms] (mean, across all concurrent requests)
Transfer rate:          2169.40 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:     1    1   0.1      1       3
Waiting:        1    1   0.1      1       3
Total:          1    1   0.1      1       3

Percentage of the requests served within a certain time (ms)
  50%      1
  66%      1
  75%      1
  80%      1
  90%      1
  95%      1
  98%      1
  99%      1
 100%      3 (longest request)

benchmark tomcat
ab -n 100000 -k -c 16 http://localhost:8080/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests

Server Software:        Apache-Coyote/1.1
Server Hostname:        localhost
Server Port:            8080

Document Path:          /
Document Length:        12 bytes

Concurrency Level:      16
Time taken for tests:   2.175 seconds
Complete requests:      100000
Failed requests:        0
Keep-Alive requests:    99008
Total transferred:      18395040 bytes
HTML transferred:       1200000 bytes
Requests per second:    45967.73 [#/sec] (mean)
Time per request:       0.348 [ms] (mean)
Time per request:       0.022 [ms] (mean, across all concurrent requests)
Transfer rate:          8257.60 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       1
Processing:     0    0   0.4      0      11
Waiting:        0    0   0.4      0      11
Total:          0    0   0.4      0      11

Percentage of the requests served within a certain time (ms)
  50%      0
  66%      0
  75%      0
  80%      0
  90%      1
  95%      1
  98%      1
  99%      2
 100%     11 (longest request)

а можно код тех бенчмарков посмотреть? что-то мне не верится что php может быть быстрее

что-то он слишком большой и тяжелый, наше приложение инициализируется 2 секунды на моем мобильнике, да jsx довольно страшный после riot'a

Information

Rating
Does not participate
Registered
Activity