본 슬라이드는 Windows환경에서 NginX구동을 실습하기 위해, PHP를 예로 들어 진행하고 있습니다. NginX는 PHP 동적웹페이지에 대한 처리보다, 정적 HTTP 서버에 적합 합니다.
본 슬라이드는 시작과 구동에 초점을 맞추고 있습니다. 설정관련 내용은 아래 공식 문서를 참조할 수 있습니다.
http://nginx.org/en/docs/beginners_guide.html
자동화된 인프라 구축
Building an Automated Infrastructure
2009년 https://groups.google.com/forum/#!forum/sysadminstudy 에서 발표했던 자료입니다.
출처 : http://wiki.tunelinux.pe.kr/pages/viewpage.action?pageId=884766
RabbitMQ/ActiveMQ 와 같은 비동기 메시징 미들웨어를 이용하여 다량의 서버를 orchestration(command & control) 할 수 있는 mcollective에 대한 한글 ppt 자료입니다. 상세한 내용은 http://wiki.tunelinux.pe.kr/x/LQAy 를 참고하시면 됩니다.
The Spock unit testing framework is on the verge of a 1.0 release and has already proven itself to be the next generation thinking on how to test Java production code. One of the many ever present challenges to testing code is the ability to Mock classes which has simplified by Spock from a very early release. Recently added to Spock is the notion of Stubs and Spies. This sessions is designed to demonstrate proper unit testing technique showing off these new features along with a number of advanced Spock features.
본 슬라이드는 Windows환경에서 NginX구동을 실습하기 위해, PHP를 예로 들어 진행하고 있습니다. NginX는 PHP 동적웹페이지에 대한 처리보다, 정적 HTTP 서버에 적합 합니다.
본 슬라이드는 시작과 구동에 초점을 맞추고 있습니다. 설정관련 내용은 아래 공식 문서를 참조할 수 있습니다.
http://nginx.org/en/docs/beginners_guide.html
자동화된 인프라 구축
Building an Automated Infrastructure
2009년 https://groups.google.com/forum/#!forum/sysadminstudy 에서 발표했던 자료입니다.
출처 : http://wiki.tunelinux.pe.kr/pages/viewpage.action?pageId=884766
RabbitMQ/ActiveMQ 와 같은 비동기 메시징 미들웨어를 이용하여 다량의 서버를 orchestration(command & control) 할 수 있는 mcollective에 대한 한글 ppt 자료입니다. 상세한 내용은 http://wiki.tunelinux.pe.kr/x/LQAy 를 참고하시면 됩니다.
The Spock unit testing framework is on the verge of a 1.0 release and has already proven itself to be the next generation thinking on how to test Java production code. One of the many ever present challenges to testing code is the ability to Mock classes which has simplified by Spock from a very early release. Recently added to Spock is the notion of Stubs and Spies. This sessions is designed to demonstrate proper unit testing technique showing off these new features along with a number of advanced Spock features.
Confd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOS충섭 김
Confd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOS
Docker Seoul Meetup #2에서 발표한 자료입니다.
CoreOS에서 confd와 sidekick service를 이용한 서비스 배포에 대한 내용입니다.
http://www.youtube.com/watch?v=5ixJCM6pAcg
영상과 함께 보시면 더 좋습니다 :)
[IoT] MAKE with Open H/W + Node.JS - 3rdPark Jonggun
IoT 시대에 Opensource H/W 와 NodeJS 를 이용하여 누구나 나만의 H/W + S/W + Service 를 만들기 위한 교육 과정을 만들어 보았습니다.
상상했던 아이디어를 Raspberry Pi 기반으로 나만의 IoT 제품을 현실로 만들어 보세요.
Lesson 1 - Introduction : IoT개요, Opensource H/W, 라즈베리파이 기초
Lesson 2 - Linux : Raspberry Pi 에서 리눅스 활용하기
Lesson 3 - Node.JS : Raspberry Pi 에서 Node.JS 로 프로그래밍 하기
Lesson 4 - Sensor : GPIO 를 Node.JS 로 동작시켜 센서 제어하기
Lesson 5 - Project : Raspberry Pi 로 스마트폰 + 무선 IoT 오디오 제작
챕터가 완성되는대로 추가적으로 공유하겠습니다.
Circulus Site - http://www.circul.us
Circulus Group - http://group.circul.us
본 장표는 인프콘 2022 / 코틀린 멀티플랫폼, 미지와의 조우 세션에 대한 강연 자료입니다.
코틀린은 멀티플랫폼을 지원하는 언어로 Server-side와 Android뿐만이 아니라 JavaScript 엔진이 있는 브라우저나 Node.js도 지원하며, Native 등 다양한 플랫폼에서 쓸 수 있습니다. 이를 이용해 코틀린 코드를 공유하는 단일 코드베이스로 모바일부터 웹과 데스크톱, 서버에 이르기까지 다중 플랫폼 애플리케이션을 작성할 수 있습니다.
본 핸즈온 세션을 통해 코틀린 멀티플랫폼과 함께 리액트, 스프링부트로 웹 애플리케이션의 프론트엔드부터 백엔드까지 직접 개발하며 친해져 보는 시간을 가져보세요. 참가자는 코틀린 멀티플랫폼 프로젝트를 이해하고, 더 나아가 프론트엔드와 백엔드 간의 공유 로직 작성, Kotlin/JS 기반 리액트 및 스프링 웹 프로그래밍을 경험할 수 있습니다.
https://github.com/arawn/building-fullstack-webapp-with-kotlin-multiplatform
https://infcon.day/speaker/박용권-김지헌-코틀린-멀티플랫폼/
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트Ji-Woong Choi
Docker를 활용하여 Gitlab CI/CD 설치 구성 및 샘플 테스트를 위한 가이드 문서이며, Docker 및 Gitlab에 대한 개요 및 사용법에 대해서는 다루지 않습니다. Docker image를 이용 Gitlab 및 Gitlab CI/CD 설치 및 구성 후 Sample Spring boot web application을 이용하여 소스 변경에 따른 commit이 발생 했을 때 Gitlab CI/CD 기능을 통해 application 테스트, 빌드, 배포까지의 일련의 과정이 자동으로 진행되는지를 테스트 하는 내용입니다.
6. Node.js 와의 성능 비교
200 OK 응답만 주었을 때의 성능 비교 72바이트 크기의 정적 파일 제공 성능 비교
7. 개인적으로 좋은 부분
1. Event-based 프로그래밍 모델을 제공하
는 프레임웍.
2. 멀티코어 리소스를 쉼게 사용.
3. Event Bus.
4. Module System.
5. Polyglot.
8. 개발자 커뮤니티
자료를 얻기 위한 실질적인 유일한 곳!!
주요 답변자
• timfox – RabbitMQ 개발자
• normanmaurer – Netty 개발자
Please don’t use StackOverflow to ask Vert.x questions – ask them here!
9. Hello World
public class MainVerticle extends Verticle {
public void start() {
container.logger().info(“MainVerticle start”);
vertx.createHttpServer().requestHandler(new Handler<HttpServerRequest>() {
public void handle(HttpServerRequest req) {
req.response().headers().set(“Content-Type”, “text/plain”);
req.response().end(“Hello World!”);
}
}).listen(8080);
}
}
10. 주의 사항
1. 코드의 중첩이 깊어지게 하지 말자
2. 차단 코드를 작성하지 말자
3. 상태전이에 주의 하자
11. 개발 환경 구축
목차
1. 환경설정
2. 설치
3. 셋팅
4. gradle project template
5. auto redeploy
6. remote debugging
13. 설치
1. 홈페이지에서 최신 버전을 다운로드 받
는다.
2. 적당한 경로에 압축을 해제한다.
3. 환경변수에 경로를 설정한다.
4. vertx 명령이 실행되는지 확인한다.
5. 앞에 작성한 Hello World 코드를 작성하
여 실행해 본다.
http://vertx.io/downloads.html
14. 설치
1. 홈페이지에서 최신 버전을 다운로드 받
는다.
2. 적당한 경로에 압축을 해제한다.
3. 환경변수에 경로를 설정한다.
4. vertx 명령이 실행되는지 확인한다.
5. 앞에 작성한 Hello World 코드를 작성하
여 실행해 본다.
jee1@~ $ cat .bashrc
PATH=“$PATH”:/home/jee1/vert.x/bin
jee1@~ $ source .bashrc
15. 설치
1. 홈페이지에서 최신 버전을 다운로드 받
는다.
2. 적당한 경로에 압축을 해제한다.
3. 환경변수에 경로를 설정한다.
4. vertx 명령이 실행되는지 확인한다.
5. 앞에 작성한 Hello World 코드를 작성하
여 실행해 본다.
jee1@~ $ vertx
usage 문구가 표시되면 설치 완료.
16. 설치
1. 홈페이지에서 최신 버전을 다운로드 받
는다.
2. 적당한 경로에 압축을 해제한다.
3. 환경변수에 경로를 설정한다.
4. vertx 명령이 실행되는지 확인한다.
5. 앞에 작성한 Hello World 코드를 작성하
여 실행해 본다.
jee1@work $ vertx run
HelloWorldVerticle.java
Verticle start.
이후 브라우저로 8080 포트에 접속하면
Hello World! 문구를 확인할 수 있음.
17. 셋팅
기본 설정은 로그가 OS의 temp 디렉토리에
vertx.log 로 생성.
설정파일 위치 vert.x/conf/logging.properties
# Put the log in the system temporary directory
# java.util.logging.FileHandler.pattern = %t/vertx.log
java.uril.logging.FileHandler.pattern =
/home/jee1/vertx/log/vertx.log
jee1@~ $ cat vertx/log/vertx.log
[vert.x-eventloop-thread-2] 03:06:37,789 INFO [null-
HelloWorldVerticle.java-704507910] Verticle start.
18. gradle project template
간단한 프로토타입은 Verticle 로 개발가능.
그러나, Module 로 개발을 권장.
Module을 개발하기 위한 방법
• Maven 을 이용한 방법
• Gradle 을 이용한 방법
Gradle 는 Groovy의 빌드 도구.
별도 설치 필요 없음.
Gradle 를 이용한 방법 선호
특별한 이유는 없으나 팀 폭스가
그래들을 사용해서 예제가 Gradle 로
되어 있음.
그래서 너도 나도 Gradle…
19. gradle project template
1. git clone 하여 eclipse로 가져오기
2. mod.json 수정
3. HelloWorldVerticle 을 Module로 이동
4. Module 실행
20. gradle project template
1. git clone 하여 eclipse로 가져오기
2. mod.json 수정
3. HelloWorldVerticle 을 Module로 이동
4. Module 실행
jee1@work $ git clone https://github.com/vert-x/vertx-
gradle-template.git my-vertx-module
jee1@work $ cd my-vertx-module/
jee1@my-vertx-modyle $ git remote rm origin
jee1@my-vertx-modyle $ ./gradlew test
jee1@my-vertx-modyle $ ./gradlew eclipse
21. gradle project template
1. git clone 하여 eclipse로 가져오기
2. mod.json 수정
3. HelloWorldVerticle 을 Module로 이동
4. Module 실행
jee1@my-vertx-modyle $ vi ./src/main/resources/mod.json
“main”:“com.mycompany.myproject.PingVerticle”
22. gradle project template
1. git clone 하여 eclipse로 가져오기
2. mod.json 수정
3. HelloWorldVerticle 을 Module로 이동
4. Module 실행
jee1@my-vertx-modyle $ vi ./src/main/resources/mod.json
// “main”:“com.mycompany.myproject.PingVerticle”
“main”:”HelloworldVerticle”
jee1@my-vertx-modyle $ ./gradlew runModEclipse
두가지 문제
23. gradle project template
1. git clone 하여 eclipse로 가져오기
2. mod.json 수정
3. HelloWorldVerticle 을 Module로 이동
4. Module 실행
jee1@my-vertx-module $ vertx runmod
com.mycompany~my-module~0.0.1 –cp bin
jee1@my-vertx-module $ vi gradle/vertx.gradle
task copyModJson( type:Copy, dependsOn: 'copyMod' ,
description: 'Copy the mod.json into the local mods directory
for runmod auto-redeploy' ) {
file( "mods/$moduleName" ).mkdirs()
from "build/mods/$moduleName/mod.json”
into "mods/$moduleName“
}
jee1@my-vertx-module $ ./gradlew copyModJson
25. remote debugging
vert.x/bin/vertx 의 시작부분에 있는
JVM_OPTS 를 수정
Eclipse의 remote debugging 에서 설정한 포
트(8000) 로 연결하면 remote debugging 사
용 가능.
#JVM_OPTS="-XX:+CMSClassUnloadingEnabled -XX:-
UseGCOverheadLimit“
#JVM_OPTS="“
JVM_OPTS="-Xdebug -
Xrunjdwp:transport=dt_socket,address=8000,server=y,suspe
nd=n”
28. Vert.x ‘s Threads
main thread 1개
vert.x-eventloop-thread 가 4개
vert.x-worker-thread 가 20개
29. Event Loops
왜 eventloop-thread 가 4개인가? org.vertx.java.core.impl.VertxExecutorFactory.java
public static EventLoopGroup eventLoopGroup(String
poolName) {
int poolSize =
Integer.getInteger( "vertx.pool.eventloop.size" ,
Runtime.getRuntime().availableProcessors());
return new NioEventLoopGroup(poolSize, new
VertxThreadFactory(poolName));
}
jee1@my-vertx-module $ grep –c processor /proc/cpuinfo
4
30. Verticle Instances
-instances 옵션을 사용하여 인스턴스를 늘
릴수 있음.
Verticle 생성시 EventLoopGroup에서 하나
의 eventloop_thread를 할당하고 Verticle을
맵핑. 동기화등의 고민없이 쉽게 작성가
능.
jee1@my-vertx-module $ vertx runmod
com.mycompany~my-module~0.0.1 –cp bin –instances 10
org.vertx.java.platform.impl.DefaultPlatformManager.java
org.vertx.java.core.impl.DefaultContext.java
org.vertx.java.core.impl.DefaultVertx.java
31. Event Loop & Verticle Instances
• Event Loops 는 코어수에 따라 쓰레드 수
를 자동 결정
• Verticle Instances 는 –instances 옵션을
지정해서 인스턴스 수 변경 가능
• 1개의 Verticle 인스턴스가 생성될 때
Event Loops 에서 하나의 eventloop-
thread 가 할당
1. vertx-eventloop-thread-0
• Verticle-0
• Verticle-4
• Verticle-8
2. vertx-eventloop-thread-1
• Verticle-1
• Verticle-5
• Verticle-9
3. vertx-eventloop-thread-2
• Verticle-2
• Verticle-6
4. vertx-eventloop-thread-3
• Verticle-3
• Verticle-7
32. Performance Test
테스트한 환경에서의 eventloop-thread 는 4
Verticle의 인스턴스 수를 1,2,4,8 로 변화시
켜 테스트 진행.
Vertx 예제에 있는 http performance
example 사용하여 테스트 진행.
(https://github.com/vert-x/vertx-
examples/tree/master/src/raw/java/httpperf)
jee1@my-vertx-module $ vertx runmod
com.mycompany~my-module~0.0.1 –cp bin (–instances
2/4/8)
jee1@java $ vertx run perf / RateCounter.java –cluster
Starting clustering…
No Cluster-host specified so using address 10.0.1.6
jee1@java $ vertx run httpperf / RerfClient.java –instances 4
–cluster
Starting clustering…
No Cluster-host specified so using address 10.0.1.6